-
-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathNameDialogViewModel.cs
More file actions
36 lines (28 loc) · 857 Bytes
/
NameDialogViewModel.cs
File metadata and controls
36 lines (28 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using Prism.Commands;
using Prism.Dialogs;
namespace PrismSample.ViewModels
{
public class NameDialogViewModel : BaseViewModel, IDialogAware
{
public NameDialogViewModel()
{
SubmitCommand = new DelegateCommand(OnSubmitTapped);
}
private string _name;
public string Name
{
get => _name;
set => SetProperty(ref _name, value);
}
public DelegateCommand SubmitCommand { get; }
private void OnSubmitTapped()
{
RequestClose(new DialogParameters { { "Name", Name } });
}
public event Action<IDialogParameters> RequestClose;
public bool CanCloseDialog() => true;
public void OnDialogClosed() { }
public void OnDialogOpened(IDialogParameters parameters) { }
}
}