Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
EmbeddedLayoutViewModel.cs
1using System;
3using System.Text;
4using CommunityToolkit.Mvvm.ComponentModel;
5using CommunityToolkit.Mvvm.Input;
8
10{
15 {
16 private readonly EmbeddedLayoutNavigationArgs? navigationArguments;
17
18 [ObservableProperty]
19 private ImageSource? renderedLayout;
20
21 [ObservableProperty]
22 private bool loaded = false;
23
29 {
30 this.navigationArguments = Args;
31 }
32
37 public override async Task OnInitializeAsync()
38 {
39 await base.OnInitializeAsync();
40
41 await MainThread.InvokeOnMainThreadAsync(async () =>
42 {
43 if (this.navigationArguments is null)
44 return;
45
46 if (this.navigationArguments.TokenItem is null)
47 return;
48
49 this.RenderedLayout = await this.navigationArguments.TokenItem.RenderEmbeddedLayout();
50 this.Loaded = true;
51 });
52 }
53 }
54}
A base class for all view models, inheriting from the BindableObject. NOTE: using this class requir...
Navigation arguments used when navigating to the embedded layout page.
View model for displaying a rendered embedded layout associated with a token.
EmbeddedLayoutViewModel(EmbeddedLayoutNavigationArgs? Args)
Initializes a new instance of the EmbeddedLayoutViewModel class.
override async Task OnInitializeAsync()
Initializes the view model asynchronously.