root / GES_PAC / ViewModel / ChambersViewModel.cs @ e837cdf1
Historique | Voir | Annoter | Télécharger (1,03 ko)
1 | 4e39035b | lbihannic | using GES_PAC.View; |
---|---|---|---|
2 | e837cdf1 | lbihannic | using GES_PAC.ViewModel.Controls; |
3 | using System.Collections.ObjectModel; |
||
4 | 09d4a0de | lbihannic | using System.Windows.Input; |
5 | |||
6 | namespace GES_PAC.ViewModel |
||
7 | { |
||
8 | public class ChambersViewModel : BaseViewModel |
||
9 | { |
||
10 | #region Attributs |
||
11 | #endregion |
||
12 | |||
13 | #region Commandes |
||
14 | 12ddf7ef | lbihannic | public ICommand TerminateSetCommand { get; } |
15 | 09d4a0de | lbihannic | #endregion |
16 | |||
17 | #region Propriétés |
||
18 | e837cdf1 | lbihannic | public ObservableCollection<ChamberButtonViewModel> Chambers { get; } = new(); |
19 | public TimerPublisher Timer { get; } |
||
20 | 09d4a0de | lbihannic | #endregion |
21 | |||
22 | #region Constructeurs |
||
23 | public ChambersViewModel() |
||
24 | { |
||
25 | 4e39035b | lbihannic | TerminateSetCommand = new Command(async () => await TerminateSet()); |
26 | e837cdf1 | lbihannic | |
27 | Timer = new TimerPublisher(); |
||
28 | Timer.Start(); |
||
29 | 09d4a0de | lbihannic | } |
30 | #endregion |
||
31 | |||
32 | #region Méthodes |
||
33 | 4e39035b | lbihannic | private async Task TerminateSet() |
34 | { |
||
35 | if (IsBusy) return; |
||
36 | IsBusy = true; |
||
37 | await Shell.Current.GoToAsync(nameof(EndSetView)); |
||
38 | IsBusy = false; |
||
39 | } |
||
40 | 09d4a0de | lbihannic | #endregion |
41 | } |
||
42 | } |