Skip to content

Commit 857844f

Browse files
committed
Upgrade to preview 9
1 parent 7d4bc84 commit 857844f

8 files changed

Lines changed: 30 additions & 17 deletions

File tree

‎samples/BlazorClientSide/App.razor‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
Configuring this here is temporary. Later we'll move the app config
33
into Program.cs, and it won't be necessary to specify AppAssembly.
44
-->
5-
<Router AppAssembly=typeof(Program).Assembly>
6-
<NotFoundContent>
7-
Route Not Found.
8-
</NotFoundContent>
9-
</Router>
5+
<Router AppAssembly="@typeof(Program).Assembly">
6+
<Found Context="routeData">
7+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
8+
</Found>
9+
<NotFound>
10+
<LayoutView Layout="@typeof(MainLayout)">
11+
<p>Sorry, there's nothing at this address.</p>
12+
</LayoutView>
13+
</NotFound>
14+
</Router>

‎samples/BlazorClientSide/BlazorClientSide.csproj‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview8.19405.7" />
15-
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview8.19405.7" PrivateAssets="all" />
16-
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.0.0-preview8.19405.7" PrivateAssets="all" />
14+
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview9.19424.4" />
15+
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview9.19424.4" PrivateAssets="all" />
16+
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.0.0-preview9.19424.4" PrivateAssets="all" />
1717
</ItemGroup>
1818

1919
<ItemGroup>

‎samples/BlazorClientSide/_Imports.razor‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@using System.Net.Http
22
@using Microsoft.AspNetCore.Components.Routing
3+
@using Microsoft.AspNetCore.Components.Web
34
@using Microsoft.JSInterop
45
@using BlazorClientSide
56
@using BlazorClientSide.Shared

‎samples/BlazorServerSide/App.razor‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
The Router component displays whichever component has a @page
33
directive matching the current URI.
44
*@
5-
<Router AppAssembly="typeof(Startup).Assembly">
6-
<NotFoundContent>
7-
Route Not Found.
8-
</NotFoundContent>
9-
</Router>
5+
<Router AppAssembly="@typeof(Program).Assembly">
6+
<Found Context="routeData">
7+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
8+
</Found>
9+
<NotFound>
10+
<LayoutView Layout="@typeof(MainLayout)">
11+
<p>Sorry, there's nothing at this address.</p>
12+
</LayoutView>
13+
</NotFound>
14+
</Router>

‎samples/BlazorServerSide/Pages/Index.razor‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@page "/"
2+
@using Microsoft.AspNetCore.Components.Web
23
@inject ISessionStorageService sessionStorage
34

45
<h1>Blazored SessionStorage Sample</h1>
@@ -47,7 +48,7 @@
4748
int ItemsInSessionStorage { get; set; }
4849
string Name { get; set; }
4950

50-
protected override async Task OnAfterRenderAsync()
51+
protected override async Task OnAfterRenderAsync(bool firstRender)
5152
{
5253
await GetNameFromSessionStorage();
5354
await GetSessionStorageLength();

‎samples/BlazorServerSide/Pages/_Host.cshtml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<link href="css/site.css" rel="stylesheet" />
2323
</head>
2424
<body>
25-
<app>@(await Html.RenderComponentAsync<App>())</app>
25+
<app>@(await Html.RenderComponentAsync<App>(RenderMode.Server))</app>
2626

2727
<script src="_framework/blazor.server.js"></script>
2828
<script src="_content/Blazored.SessionStorage/blazored-sessionstorage.js"></script>

‎samples/BlazorServerSide/_Imports.razor‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@using System.Net.Http
22
@using Microsoft.AspNetCore.Components.Forms
33
@using Microsoft.AspNetCore.Components.Routing
4+
@using Microsoft.AspNetCore.Components.Web
45
@using Microsoft.JSInterop
56
@using BlazorServerSide.Shared
67

‎src/Blazored.SessionStorage/Blazored.SessionStorage.csproj‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
</PropertyGroup>
2121

2222
<ItemGroup>
23-
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.0.0-preview8.19405.7" />
24-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.0.0-preview8.19405.7" />
23+
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.0.0-preview9.19424.4" />
24+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.0.0-preview9.19424.4" />
2525
</ItemGroup>
2626

2727
</Project>

0 commit comments

Comments
 (0)