Skip to content

Commit 06eb089

Browse files
update to .net6-rc1
1 parent 1203b85 commit 06eb089

21 files changed

Lines changed: 120 additions & 155 deletions

File tree

BlazorContextMenu/BlazorContextMenu.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.1</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
<IsPackable>true</IsPackable>
6-
<RazorLangVersion>3.0</RazorLangVersion>
76

87
<!-- This custom package feed is required only when using nightly builds of Blazor -->
98
<!-- <RestoreSources>https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;$(RestoreSources)</RestoreSources> -->
@@ -46,7 +45,7 @@
4645
</ItemGroup>
4746

4847
<ItemGroup>
49-
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.0" />
50-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.0" />
48+
<PackageReference Include="Microsoft.AspNetCore.Components" Version="6.0.0-rc.1.21452.15" />
49+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.0-rc.1.21452.15" />
5150
</ItemGroup>
5251
</Project>

TestApps/BlazorContextMenu.TestAppsCommon/BlazorContextMenu.TestAppsCommon.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.1</TargetFramework>
5-
<LangVersion>7.3</LangVersion>
6-
<RazorLangVersion>3.0</RazorLangVersion>
4+
<TargetFramework>net6.0</TargetFramework>
75
</PropertyGroup>
86

97
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.0" />
8+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.0-rc.1.21452.15" />
119
</ItemGroup>
1210

1311
<ItemGroup>
Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Router AppAssembly="@typeof(Program).Assembly">
1+
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
22
<Found Context="routeData">
33
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
44
</Found>
@@ -8,16 +8,3 @@
88
</LayoutView>
99
</NotFound>
1010
</Router>
11-
12-
13-
14-
@*@inject IJSRuntime jsRuntime
15-
@code{
16-
protected override async Task OnAfterRenderAsync(bool firstRender)
17-
{
18-
if (firstRender)
19-
{
20-
await jsRuntime.InvokeVoidAsync("TestApp_AppLoaded");
21-
}
22-
}
23-
}*@

TestApps/BlazorTestApp/BlazorContextMenu.BlazorTestApp.Client/BlazorContextMenu.BlazorTestApp.Client.csproj

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.1</TargetFramework>
5-
<LangVersion>7.3</LangVersion>
6-
<RazorLangVersion>3.0</RazorLangVersion>
7-
8-
<!-- This custom package feed is required only when using nightly builds of Blazor -->
9-
<!-- <RestoreSources>$(RestoreSources);https://dotnet.myget.org/f/blazor-dev/api/v3/index.json</RestoreSources> -->
4+
<TargetFramework>net6.0</TargetFramework>
105
</PropertyGroup>
116

127
<ItemGroup>
13-
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.1.0-preview4.19579.2" />
14-
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.1.0-preview4.19579.2" PrivateAssets="all" />
15-
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.1.0-preview4.19579.2" />
8+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.0-rc.1.21452.15" />
9+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.0-rc.1.21452.15" PrivateAssets="all" />
1610
</ItemGroup>
1711

1812
<ItemGroup>
Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,47 @@
1-
using Microsoft.AspNetCore.Blazor.Hosting;
1+
using BlazorContextMenu;
2+
using BlazorContextMenu.BlazorTestApp.Client;
3+
using BlazorContextMenu.BlazorTestApp.Client.Services;
4+
using BlazorContextMenu.TestAppsCommon;
5+
using Microsoft.AspNetCore.Components.Web;
6+
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
27
using Microsoft.Extensions.DependencyInjection;
38
using System;
9+
using System.Net.Http;
410

5-
namespace BlazorContextMenu.BlazorTestApp.Client
11+
var builder = WebAssemblyHostBuilder.CreateDefault(args);
12+
builder.RootComponents.Add<App>("#app");
13+
builder.RootComponents.Add<HeadOutlet>("head::after");
14+
builder.Services.AddScoped<ISampleDataService, SampleDataService>();
15+
builder.Services.AddBlazorContextMenu(options =>
616
{
7-
public class Program
17+
options.ConfigureTemplate(defaultTemplate =>
818
{
9-
public static void Main(string[] args)
10-
{
11-
CreateHostBuilder(args).Build().Run();
12-
}
19+
defaultTemplate.MenuCssClass = "my-menu";
20+
defaultTemplate.MenuItemCssClass = "my-menu-item";
21+
defaultTemplate.SeperatorCssClass = "my-menu-seperator";
22+
});
1323

14-
public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) =>
15-
BlazorWebAssemblyHost.CreateDefaultBuilder()
16-
.UseBlazorStartup<Startup>();
17-
}
18-
}
24+
options.ConfigureTemplate("red", template =>
25+
{
26+
template.MenuCssClass = "red-menu";
27+
template.MenuItemCssClass = "red-menu-item";
28+
template.MenuItemDisabledCssClass = "red-menu-item--disabled";
29+
template.SeperatorHrCssClass = "red-menu-seperator-hr";
30+
template.MenuItemWithSubMenuCssClass = "red-menu-item--with-submenu";
31+
template.Animation = Animation.FadeIn;
32+
});
33+
34+
options.ConfigureTemplate("dark", template =>
35+
{
36+
template.MenuCssClass = "dark-menu";
37+
template.MenuItemCssClass = "dark-menu-item";
38+
template.MenuItemDisabledCssClass = "dark-menu-item--disabled";
39+
template.SeperatorHrCssClass = "dark-menu-seperator-hr";
40+
template.MenuItemWithSubMenuCssClass = "dark-menu-item--with-submenu";
41+
template.Animation = Animation.FadeIn;
42+
});
43+
});
44+
45+
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
46+
47+
await builder.Build().RunAsync();

TestApps/BlazorTestApp/BlazorContextMenu.BlazorTestApp.Client/Properties/launchSettings.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
},
1818
"BlazorContextMenu.BlazorTestApp": {
1919
"commandName": "Project",
20+
"dotnetRunMessages": "true",
2021
"launchBrowser": true,
22+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
23+
"applicationUrl": "https://localhost:5001;http://localhost:5000",
2124
"environmentVariables": {
2225
"ASPNETCORE_ENVIRONMENT": "Development"
23-
},
24-
"applicationUrl": "http://localhost:64255/"
26+
}
2527
}
2628
}
2729
}

TestApps/BlazorTestApp/BlazorContextMenu.BlazorTestApp.Client/Services/SampleDataService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Collections.Generic;
55
using System.Linq;
66
using System.Net.Http;
7+
using System.Net.Http.Json;
78
using System.Threading.Tasks;
89

910
namespace BlazorContextMenu.BlazorTestApp.Client.Services
@@ -19,7 +20,7 @@ public SampleDataService(HttpClient http)
1920

2021
public async Task<string[]> GetSampleData()
2122
{
22-
var summaries = await _http.GetJsonAsync<string[]>("api/SampleData/Summaries");
23+
var summaries = await _http.GetFromJsonAsync<string[]>("api/SampleData/Summaries");
2324
return summaries;
2425
}
2526
}

TestApps/BlazorTestApp/BlazorContextMenu.BlazorTestApp.Client/Startup.cs

Lines changed: 0 additions & 53 deletions
This file was deleted.

TestApps/BlazorTestApp/BlazorContextMenu.BlazorTestApp.Client/wwwroot/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
<link href="_content/Blazor.ContextMenu/blazorContextMenu.min.css" rel="stylesheet" />
1212
</head>
1313
<body>
14-
<app>Loading...</app>
14+
<div id="app">Loading...</div>
15+
1516
<script src="_content/BlazorContextMenu.TestAppsCommon/interop.js"></script>
1617
<script src="_content/Blazor.ContextMenu/blazorContextMenu.js"></script>
1718
<script src="_framework/blazor.webassembly.js"></script>

TestApps/BlazorTestApp/BlazorContextMenu.BlazorTestApp.Server/BlazorContextMenu.BlazorTestApp.Server.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
5-
<LangVersion>7.3</LangVersion>
4+
<TargetFramework>net6.0</TargetFramework>
65
</PropertyGroup>
76

87
<ItemGroup>
9-
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.1.0-preview4.19579.2" />
10-
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" />
8+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="6.0.0-rc.1.21452.15" />
9+
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0-rc.1.21452.15" />
1110
</ItemGroup>
1211

1312
<ItemGroup>

0 commit comments

Comments
 (0)