root / GES_PAC / ViewModel / AppShellViewModel.cs @ master
Historique | Voir | Annoter | Télécharger (606 octets)
1 | 18f910c6 | Lucas Bihannic | using System.Windows.Input; |
---|---|---|---|
2 | |||
3 | namespace GES_PAC.ViewModel |
||
4 | { |
||
5 | public class AppShellViewModel : BaseViewModel |
||
6 | { |
||
7 | |||
8 | public ICommand QuitterCommand { get; private set; } |
||
9 | public AppShellViewModel() |
||
10 | { |
||
11 | QuitterCommand = new Command(async () => await Quitter()); |
||
12 | } |
||
13 | |||
14 | private async Task Quitter() |
||
15 | { |
||
16 | await Task.Delay(100); |
||
17 | bool quitter = await App.Current.MainPage.DisplayAlert("Voulez-vous vraiment quitter l'application ?", "", "Oui", "Non"); |
||
18 | if (quitter.Equals(true)) Application.Current.Quit(); |
||
19 | } |
||
20 | |||
21 | } |
||
22 | } |