Skip to content

Commit d105371

Browse files
committed
Updated TextEditorDemo to .Net 9
1 parent feeb008 commit d105371

File tree

5 files changed

+39
-17
lines changed

5 files changed

+39
-17
lines changed

samples/TextEditorDemo/App.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Router AppAssembly="@typeof(App).Assembly">
22
<Found Context="routeData">
3-
<RouteView DefaultLayout="@typeof(MainLayout)" RouteData="@routeData"/>
4-
<FocusOnNavigate RouteData="@routeData" Selector="h1"/>
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4+
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
55
</Found>
66
<NotFound>
77
<PageTitle>Not found</PageTitle>
88
<LayoutView Layout="@typeof(MainLayout)">
99
<p role="alert">Sorry, there's nothing at this address.</p>
1010
</LayoutView>
1111
</NotFound>
12-
</Router>
12+
</Router>

samples/TextEditorDemo/Program.cs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
using Microsoft.AspNetCore.Components.Web;
22
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
3-
using TextEditorDemo;
43

5-
var builder = WebAssemblyHostBuilder.CreateDefault(args);
6-
builder.RootComponents.Add<App>("#app");
7-
builder.RootComponents.Add<HeadOutlet>("head::after");
4+
namespace TextEditorDemo
5+
{
6+
public class Program
7+
{
8+
public static async Task Main(string[] args)
9+
{
10+
var builder = WebAssemblyHostBuilder.CreateDefault(args);
11+
builder.RootComponents.Add<App>("#app");
12+
builder.RootComponents.Add<HeadOutlet>("head::after");
813

9-
builder.Services.AddScoped(sp => new HttpClient {BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)});
14+
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
1015

11-
await builder.Build().RunAsync();
16+
await builder.Build().RunAsync();
17+
}
18+
}
19+
}

samples/TextEditorDemo/TextEditorDemo.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.9" />
11-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.9" PrivateAssets="all" />
10+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.4" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.4" PrivateAssets="all" />
1212
</ItemGroup>
1313

1414
<ItemGroup>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
@using System.Net.Http
22
@using System.Net.Http.Json
3+
@using Microsoft.AspNetCore.Components.Forms
34
@using Microsoft.AspNetCore.Components.Routing
45
@using Microsoft.AspNetCore.Components.Web
6+
@using Microsoft.AspNetCore.Components.Web.Virtualization
57
@using Microsoft.AspNetCore.Components.WebAssembly.Http
68
@using Microsoft.JSInterop
79
@using TextEditorDemo
810

9-
@using Blazored.TextEditor
11+
@using Blazored.TextEditor

samples/TextEditorDemo/wwwroot/index.html

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33

44
<head>
55
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
67
<title>TextEditorDemo</title>
78
<base href="/" />
8-
<link href="css/app.css" rel="stylesheet" />
9+
<link rel="stylesheet" href="lib/bootstrap/dist/css/bootstrap.min.css" />
10+
<link rel="stylesheet" href="css/app.css" />
911

1012
<!-- If you add any scoped CSS files, uncomment the following to load them
1113
<link href="TextEditorDemo.styles.css" rel="stylesheet" /> -->
@@ -14,15 +16,24 @@
1416

1517
<!-- Include your favorite highlight.js stylesheet -->
1618
<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css" rel="stylesheet">
19+
20+
<link rel="icon" type="image/png" href="favicon.png" />
21+
<link href="TextEditorDemo.styles.css" rel="stylesheet" />
1722
</head>
1823

1924
<body>
20-
<div id="app">Loading...</div>
25+
<div id="app">
26+
<svg class="loading-progress">
27+
<circle r="40%" cx="50%" cy="50%" />
28+
<circle r="40%" cx="50%" cy="50%" />
29+
</svg>
30+
<div class="loading-progress-text"></div>
31+
</div>
2132

2233
<div id="blazor-error-ui">
2334
An unhandled error has occurred.
24-
<a href="" class="reload">Reload</a>
25-
<a class="dismiss">🗙</a>
35+
<a href="." class="reload">Reload</a>
36+
<span class="dismiss">🗙</span>
2637
</div>
2738
<script src="_framework/blazor.webassembly.js"></script>
2839

@@ -35,3 +46,4 @@
3546
</body>
3647

3748
</html>
49+

0 commit comments

Comments
 (0)