-
-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathSelectorPageViewModel.cs
More file actions
31 lines (26 loc) · 832 Bytes
/
SelectorPageViewModel.cs
File metadata and controls
31 lines (26 loc) · 832 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
using Prism.Commands;
using Prism.Dialogs;
using PrismSample.Models;
namespace PrismSample.ViewModels
{
public class SelectorPageViewModel : BaseViewModel
{
private readonly IDialogService _dialogService;
public SelectorPageViewModel(IDialogService dialogService)
{
_dialogService = dialogService;
GetContactCommand = new DelegateCommand(OnGetContactTapped);
}
private Contact _contact;
public Contact Contact
{
get => _contact;
set => SetProperty(ref _contact, value);
}
public DelegateCommand GetContactCommand { get; }
private async void OnGetContactTapped()
{
Contact = await _dialogService.ShowDialogAsync<Contact>("ContactSelectorDialog");
}
}
}