Skip to content

Commit 1c8eea8

Browse files
committed
Broken sample
1 parent f5de847 commit 1c8eea8

File tree

11 files changed

+116
-0
lines changed

11 files changed

+116
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"dotnet.defaultSolution": "ComponentTwentySix.sln"
3+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Router AppAssembly="typeof(Program).Assembly">
2+
<Found Context="routeData">
3+
<RouteView RouteData="routeData" DefaultLayout="typeof(MainLayout)" />
4+
</Found>
5+
<NotFound>
6+
<h1>Page not found</h1>
7+
<p>Sorry, but there's nothing here!</p>
8+
</NotFound>
9+
</Router>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
2+
<PropertyGroup>
3+
<TargetFramework>net8.0</TargetFramework>
4+
<ImplicitUsings>true</ImplicitUsings>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0-preview.7.*" />
8+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0-preview.7.*" />
9+
<Watch Include="**\*.cshtml" />
10+
<Watch Include="**\*.razor" />
11+
</ItemGroup>
12+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.002.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComponentTwentySix", "ComponentTwentySix.csproj", "{864B5B16-E06A-4657-B36C-03F5521B97A5}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{864B5B16-E06A-4657-B36C-03F5521B97A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{864B5B16-E06A-4657-B36C-03F5521B97A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{864B5B16-E06A-4657-B36C-03F5521B97A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{864B5B16-E06A-4657-B36C-03F5521B97A5}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {CF583341-A911-452F-A8D0-D6DF6B54D7C7}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@page "/"
2+
3+
<h1>Dynamic Cascading Values</h1>
4+
Keep refreshing the page to see the date and time change
5+
6+
<InnerComponentOne />
7+
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<h2>Inner Component One</h2>
2+
3+
@HelloMessage.Message
4+
5+
@code {
6+
[CascadingParameter(Name="hello")]
7+
protected MessageCascade HelloMessage { get; set; } = default!;
8+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
2+
using Microsoft.AspNetCore.Components;
3+
using ComponentTwentySix;
4+
5+
var builder = WebAssemblyHostBuilder.CreateDefault(args);
6+
builder.RootComponents.Add<App>("app");
7+
builder.Services.AddCascadingValue("hello", sp =>
8+
{
9+
var msg = new MessageCascade("Hello World! " + DateTime.Now);
10+
var source = new CascadingValueSource<MessageCascade>(msg, isFixed: false);
11+
return source;
12+
});
13+
14+
var app = builder.Build();
15+
await app.RunAsync();
16+
17+
public record MessageCascade(string Message);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Setting root level dynamic cascading values
2+
3+
This sample shows how to set root level **dynamic** cascading **values using `CascadingValueSource`.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@inherits LayoutComponentBase
2+
3+
<div class="main">
4+
<div class="content px-4">
5+
@Body
6+
</div>
7+
</div>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@using Microsoft.AspNetCore.Components.Web
2+
@using Microsoft.AspNetCore.Components.Routing
3+
@using Microsoft.JSInterop
4+
@using ComponentTwentySix
5+
@using ComponentTwentySix.Shared

0 commit comments

Comments
 (0)