File tree Expand file tree Collapse file tree 5 files changed +25
-15
lines changed
src/Components/Samples/BlazorUnitedApp Expand file tree Collapse file tree 5 files changed +25
-15
lines changed Original file line number Diff line number Diff line change 1717 <Routes @rendermode =" InteractiveServer" />
1818 <script src =" @Assets[" _framework /blazor.web.js " ]" autostart =" false" ></script >
1919 <script >
20- Blazor .start ({
21- circuit: {
22- reconnectionHandler: {
23- onConnectionDown : () => displayReconectButton (),
24- onConnectionUp : () => {
25- // revertState();
26- }
27- },
28- detailedErrors: true
29- }
30- });
20+ Blazor .start ();
21+ // Blazor.start({
22+ // circuit: {
23+ // reconnectionHandler: {
24+ // onConnectionDown: () => (),
25+ // onConnectionUp: () => {
26+ // // revertState();
27+ // }
28+ // },
29+ // detailedErrors: true
30+ // }
31+ // });
3132
3233 function disconnect () {
3334 console .log (" Disconnecting" )
Original file line number Diff line number Diff line change 11// Licensed to the .NET Foundation under one or more agreements.
22// The .NET Foundation licenses this file to you under the MIT license.
33
4+ using System . Diagnostics ;
5+
46namespace BlazorUnitedApp . Data ;
57
8+ [ DebuggerDisplay ( $ "{{{nameof(GetDebuggerDisplay)}(),nq}}") ]
69public class WeatherForecast
710{
811 public DateOnly Date { get ; set ; }
@@ -12,4 +15,7 @@ public class WeatherForecast
1215 public int TemperatureF => 32 + ( int ) ( TemperatureC / 0.5556 ) ;
1316
1417 public string ? Summary { get ; set ; }
18+
19+ private string GetDebuggerDisplay ( ) =>
20+ $ "{ Date : yyyy-MM-dd} : { TemperatureC } °C ({ TemperatureF } °F) - { Summary ?? "No summary" } ";
1521}
Original file line number Diff line number Diff line change 66
77<h1 >Weather forecast</h1 >
88
9- @Guid.NewGuid().ToString()
9+ @_guid
1010
1111<p >This component demonstrates fetching data from a service.</p >
1212
4343
4444 [SupplyParameterFromPersistentComponentState ] public WeatherForecast []? Forecasts { get ; set ; }
4545
46+ private string _guid ;
47+
4648 protected override async Task OnInitializedAsync ()
4749 {
50+ _guid = Guid .NewGuid ().ToString ();
4851 Forecasts ??= await ForecastService .GetForecastAsync (DateOnly .FromDateTime (DateTime .Now ));
4952 }
5053}
Original file line number Diff line number Diff line change 1111 . AddInteractiveWebAssemblyComponents ( )
1212 . AddInteractiveServerComponents ( o =>
1313 {
14- o . DisconnectedCircuitMaxRetained = 5 ;
15- o . DisconnectedCircuitRetentionPeriod = TimeSpan . FromSeconds ( 2 ) ;
14+ o . DisconnectedCircuitMaxRetained = 0 ;
15+ o . DisconnectedCircuitRetentionPeriod = TimeSpan . FromSeconds ( 0 ) ;
1616 } ) ;
1717
1818builder . Services . AddSingleton < WeatherForecastService > ( ) ;
Original file line number Diff line number Diff line change 2323 "dotnetRunMessages" : true ,
2424 "launchBrowser" : true ,
2525 "launchUrl" : " fetchdata" ,
26- "applicationUrl" : " https://localhost:7247; http://localhost:5265" ,
26+ "applicationUrl" : " http://localhost:5265" ,
2727 //"inspectUri": "{wsProtocol }://{url.hostname }:{url.port }/_framework/debug/ws-proxy?browser={browserInspectUri}",
2828 "environmentVariables" : {
2929 "ASPNETCORE_ENVIRONMENT" : " Development"
You can’t perform that action at this time.
0 commit comments