root / GES_PAC / ViewModel / MainViewModel.cs @ 612877b5
Historique | Voir | Annoter | Télécharger (859 octets)
1 | 18f910c6 | Lucas Bihannic | using GES_PAC.Services; |
---|---|---|---|
2 | 65ad7e66 | Lucas Bihannic | using GES_PAC.View; |
3 | |||
4 | namespace GES_PAC.ViewModel |
||
5 | { |
||
6 | public class MainViewModel : BaseViewModel |
||
7 | { |
||
8 | 18f910c6 | Lucas Bihannic | #region Services |
9 | private readonly ConnexionService connService; |
||
10 | #endregion |
||
11 | |||
12 | #region Commandes |
||
13 | 65ad7e66 | Lucas Bihannic | public Command GoToCreateDayCommand { get; } |
14 | 18f910c6 | Lucas Bihannic | #endregion |
15 | |||
16 | #region Constructeur |
||
17 | public MainViewModel(ConnexionService connService) |
||
18 | 65ad7e66 | Lucas Bihannic | { |
19 | 18f910c6 | Lucas Bihannic | this.connService = connService; |
20 | 65ad7e66 | Lucas Bihannic | GoToCreateDayCommand = new Command(async () => await GoToCreateDayPage()); |
21 | } |
||
22 | 18f910c6 | Lucas Bihannic | #endregion |
23 | 65ad7e66 | Lucas Bihannic | |
24 | 18f910c6 | Lucas Bihannic | #region Méthodes |
25 | 65ad7e66 | Lucas Bihannic | private async Task GoToCreateDayPage() |
26 | { |
||
27 | 1019554c | lbihannic | if (IsBusy) return; |
28 | 18f910c6 | Lucas Bihannic | IsBusy = true; |
29 | 65ad7e66 | Lucas Bihannic | await Shell.Current.GoToAsync(nameof(CreateDayView)); |
30 | 18f910c6 | Lucas Bihannic | IsBusy = false; |
31 | 65ad7e66 | Lucas Bihannic | } |
32 | 18f910c6 | Lucas Bihannic | #endregion |
33 | 65ad7e66 | Lucas Bihannic | } |
34 | } |