Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
AddTextNoteViewModel.cs
1
using
CommunityToolkit.Mvvm.ComponentModel;
2
using
CommunityToolkit.Mvvm.Input;
3
using
Mopups.Services;
4
using
NeuroAccessMaui.UI.Pages
;
5
6
namespace
NeuroAccessMaui.UI.Popups.Tokens.AddTextNote
7
{
11
public
partial class
AddTextNoteViewModel
:
BaseViewModel
12
{
13
private
readonly TaskCompletionSource<bool?> result =
new
();
14
18
public
AddTextNoteViewModel
()
19
: base()
20
{
21
}
22
26
public
Task<bool?>
Result
=> this.result.Task;
27
31
[ObservableProperty]
32
[NotifyCanExecuteChangedFor(nameof(AddNoteCommand))]
33
private
string
? textNote;
34
38
[ObservableProperty]
39
private
bool
personal;
40
44
public
bool
CanAddNote
=> !
string
.IsNullOrEmpty(this.TextNote);
45
49
[RelayCommand(CanExecute = nameof(
CanAddNote
))]
50
private
async Task AddNote()
51
{
52
this.result.TrySetResult(!
string
.IsNullOrEmpty(this.TextNote));
53
await MopupService.Instance.PopAsync();
54
}
55
59
[RelayCommand]
60
private
async Task Cancel()
61
{
62
this.result.TrySetResult(
false
);
63
await MopupService.Instance.PopAsync();
64
}
65
69
internal
void
Close()
70
{
71
this.result.TrySetResult(
null
);
72
}
73
}
74
}
NeuroAccessMaui.UI.Pages.BaseViewModel
A base class for all view models, inheriting from the BindableObject. NOTE: using this class requir...
Definition:
BaseViewModel.cs:17
NeuroAccessMaui.UI.Popups.Tokens.AddTextNote.AddTextNoteViewModel
View model for popup page prompting the user for a text note to be added.
Definition:
AddTextNoteViewModel.cs:12
NeuroAccessMaui.UI.Popups.Tokens.AddTextNote.AddTextNoteViewModel.CanAddNote
bool CanAddNote
If the note can be added.
Definition:
AddTextNoteViewModel.cs:44
NeuroAccessMaui.UI.Popups.Tokens.AddTextNote.AddTextNoteViewModel.Result
Task< bool?> Result
Result will be provided here. If dialog is cancelled, null is returned.
Definition:
AddTextNoteViewModel.cs:26
NeuroAccessMaui.UI.Popups.Tokens.AddTextNote.AddTextNoteViewModel.AddTextNoteViewModel
AddTextNoteViewModel()
View model for popup page prompting the user for a text note to be added.
Definition:
AddTextNoteViewModel.cs:18
NeuroAccessMaui.UI.Pages
Definition:
ApplicationsPage.xaml.cs:2
NeuroAccessMaui.UI.Popups.Tokens.AddTextNote
Definition:
AddTextNotePopup.cs:2
NeuroAccessMaui
NeuroAccessMaui
UI
Popups
Tokens
AddTextNote
AddTextNoteViewModel.cs
Generated by
1.9.5