This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a64e8ee
commit d19b295
Showing
8 changed files
with
48 additions
and
16 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...e/BitzArt.Blazor.MVVM.SampleApp/BitzArt.Blazor.MVVM.SampleApp.Client/Pages/TestPage.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@page "/test" | ||
@rendermode @(new InteractiveWebAssemblyRenderMode(prerender: true)) | ||
@inherits PageBase<TestPageViewModel> | ||
|
||
<h3>TestPage</h3> | ||
|
||
<p>@ViewModel.State?.Text</p> | ||
|
||
<ComponentStateContainer ViewModel="ViewModel" /> |
19 changes: 19 additions & 0 deletions
19
...lazor.MVVM.SampleApp/BitzArt.Blazor.MVVM.SampleApp.Client/ViewModels/TestPageViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace BitzArt.Blazor.MVVM.SampleApp; | ||
|
||
public class TestPageViewModel : ViewModel<TestPageState> | ||
{ | ||
protected override void OnDependenciesInjected() | ||
{ | ||
OnStateInitializedAsync += async (_) => | ||
{ | ||
await Task.Delay(2000); | ||
State.Text = "Test Page State initialized"; | ||
ComponentStateHasChanged(); | ||
}; | ||
} | ||
} | ||
|
||
public class TestPageState : ComponentState | ||
{ | ||
public string Text { get; set; } = "Test Page State not initialized"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters