Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
SubscribeToViewModel.cs
1using CommunityToolkit.Mvvm.ComponentModel;
2using CommunityToolkit.Mvvm.Input;
3using Mopups.Services;
5
7{
11 public partial class SubscribeToViewModel : BaseViewModel
12 {
13 private readonly TaskCompletionSource<bool?> result = new();
14
19 public SubscribeToViewModel(string BareJid)
20 : base()
21 {
22 this.BareJid = BareJid;
23 }
24
28 [ObservableProperty]
29 private string bareJid;
30
34 public Task<bool?> Result => this.result.Task;
35
39 [RelayCommand]
40 private async Task Yes()
41 {
42 this.result.TrySetResult(true);
43 await MopupService.Instance.PopAsync();
44 }
45
49 [RelayCommand]
50 private async Task No()
51 {
52 this.result.TrySetResult(false);
53 await MopupService.Instance.PopAsync();
54 }
55
59 internal void Close()
60 {
61 this.result.TrySetResult(null);
62 }
63 }
64}
A base class for all view models, inheriting from the BindableObject. NOTE: using this class requir...
SubscribeToViewModel(string BareJid)
View model for SubscribeToPopup
Task< bool?> Result
Result will be provided here. If dialog is cancelled, null is returned.