sicpaconnexions / SICPA_Connexions / ViewModel / AppShellViewModel.cs @ 03682d21
Historique | Voir | Annoter | Télécharger (801 octets)
1 |
using SICPA_Connexions.ViewModel.Base; |
---|---|
2 |
using System; |
3 |
using System.Collections.Generic; |
4 |
using System.Linq; |
5 |
using System.Text; |
6 |
using System.Threading.Tasks; |
7 |
using System.Windows.Input; |
8 |
|
9 |
namespace SICPA_Connexions.ViewModel |
10 |
{ |
11 |
public class AppShellViewModel : BaseViewModel |
12 |
{ |
13 |
|
14 |
public ICommand QuitterCommand { get; private set; } |
15 |
public AppShellViewModel() |
16 |
{ |
17 |
QuitterCommand = new Command(async () => await Quitter()); |
18 |
} |
19 |
|
20 |
private async Task Quitter() |
21 |
{ |
22 |
await Task.Delay(100); |
23 |
bool quitter = await App.Current.MainPage.DisplayAlert("Voulez-vous vraiment quitter l'application ?", "", "Oui", "Non"); |
24 |
if (quitter.Equals(true)) Application.Current.Quit(); |
25 |
} |
26 |
|
27 |
} |
28 |
} |