-
-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathMainPageViewModel.cs
More file actions
35 lines (30 loc) · 1.07 KB
/
MainPageViewModel.cs
File metadata and controls
35 lines (30 loc) · 1.07 KB
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
using Prism.Commands;
using Prism.Dialogs;
namespace PrismSample.ViewModels
{
public class MainPageViewModel : BaseViewModel
{
private readonly IDialogService _dialogService;
public MainPageViewModel(IDialogService dialogService)
{
_dialogService = dialogService;
Title = "Dialog Service";
LockingDialogCommand = new DelegateCommand(OnLockingDialogTapped);
TapToCloseDialogCommand = new DelegateCommand(OnTapToCloseDialogTapped);
}
public DelegateCommand LockingDialogCommand { get; }
public DelegateCommand TapToCloseDialogCommand { get; }
private void OnLockingDialogTapped()
{
_dialogService.ShowDialog("LockingDialog?Question=Can navigate away?");
}
private void OnTapToCloseDialogTapped()
{
_dialogService.ShowDialog("LockingDialog", new DialogParameters
{
{ "Question", "Tap outside to close?" },
{ "CloseOnTap", true }
});
}
}
}