File tree Expand file tree Collapse file tree 1 file changed +3
-20
lines changed
src/Components/Samples/BlazorUnitedApp/Pages Expand file tree Collapse file tree 1 file changed +3
-20
lines changed Original file line number Diff line number Diff line change 44
55<h1 >Counter</h1 >
66
7- <p role =" status" >Current count: @Current.Count </p >
7+ <p role =" status" >Current count: @currentCount </p >
88
99<button class =" btn btn-primary" @onclick =" IncrementCount" >Click me</button >
1010
1111@code {
12-
13- [SupplyParameterFromPersistentComponentState ]
14- public CounterState Current { get ; set ; } = new ();
15-
16- protected override void OnInitialized ()
17- {
18- Current ??= new CounterState () { Count = RendererInfo .IsInteractive ? 0 : 5 };
19- }
12+ private int currentCount = 0 ;
2013
2114 private void IncrementCount ()
2215 {
23- Current .Increment ();
24- }
25-
26- public class CounterState
27- {
28- public int Count { get ; set ; } = 0 ;
29-
30- public void Increment ()
31- {
32- Count ++ ;
33- }
16+ currentCount ++ ;
3417 }
3518}
You can’t perform that action at this time.
0 commit comments