File tree Expand file tree Collapse file tree
src/ElectronNET.Templates/templates/blazor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030 }
3131 ],
3232 "replaces" : " net8.0" ,
33- "defaultValue" : " net8 .0"
33+ "defaultValue" : " net10 .0"
3434 },
3535 "ElectronVersion" : {
3636 "type" : " parameter" ,
Original file line number Diff line number Diff line change 55 <meta charset =" utf-8" />
66 <meta name =" viewport" content =" width=device-width, initial-scale=1.0" />
77 <base href =" /" />
8+ <ResourcePreloader />
89 <link rel =" stylesheet" href =" app.css" />
10+ <ImportMap />
911 <title >ElectronBlazorApp</title >
1012 <HeadOutlet />
1113</head >
Original file line number Diff line number Diff line change 11using ElectronNET . API ;
22using ElectronNET . API . Entities ;
3+ using ElectronNET . AspNet . Middleware ;
4+ using ElectronNET . AspNet . Services ;
35
46var builder = WebApplication . CreateBuilder ( args ) ;
57
68builder . Services . AddRazorComponents ( )
79 . AddInteractiveServerComponents ( ) ;
810
11+ builder . Services . AddSingleton < IElectronAuthenticationService , ElectronAuthenticationService > ( ) ;
12+
13+ builder . Services . AddElectron ( ) ;
14+
915// Starts the Electron shell and invokes ElectronAppReady once it is up.
1016builder . UseElectron ( args , ElectronAppReady ) ;
1117
1218var app = builder . Build ( ) ;
1319
20+ app . UseMiddleware < ElectronAuthenticationMiddleware > ( ) ;
21+ app . UseRouting ( ) ;
22+
23+ if ( ! app . Environment . IsDevelopment ( ) )
24+ {
25+ app . UseExceptionHandler ( "/Error" , createScopeForErrors : true ) ;
26+ }
27+
1428app . UseStaticFiles ( ) ;
1529app . UseAntiforgery ( ) ;
1630
@@ -24,6 +38,7 @@ static async Task ElectronAppReady()
2438{
2539 var window = await Electron . WindowManager . CreateWindowAsync ( new BrowserWindowOptions
2640 {
41+ IsRunningBlazor = true ,
2742 Width = 1152 ,
2843 Height = 940 ,
2944 Show = false ,
You can’t perform that action at this time.
0 commit comments