root / GES_PAC / ViewModel / JourneeViewModel.cs @ 12ddf7ef
Historique | Voir | Annoter | Télécharger (992 octets)
1 | 65ad7e66 | Lucas Bihannic | using GES_PAC.Model; |
---|---|---|---|
2 | using System.Collections.ObjectModel; |
||
3 | |||
4 | namespace GES_PAC.ViewModel |
||
5 | { |
||
6 | public class JourneeViewModel |
||
7 | { |
||
8 | 18f910c6 | Lucas Bihannic | #region Attributs |
9 | 65ad7e66 | Lucas Bihannic | private static JourneeViewModel _instance; |
10 | 18f910c6 | Lucas Bihannic | #endregion |
11 | |||
12 | #region Propriétés |
||
13 | public ObservableCollection<Journee> Journees { get; set; } = new(); |
||
14 | 65ad7e66 | Lucas Bihannic | public static JourneeViewModel Instance => _instance ??= new JourneeViewModel(); |
15 | 18f910c6 | Lucas Bihannic | #endregion |
16 | 65ad7e66 | Lucas Bihannic | |
17 | 5d673ce0 | Lucas Bihannic | #region Constructeurs |
18 | 65ad7e66 | Lucas Bihannic | private JourneeViewModel() { } |
19 | 18f910c6 | Lucas Bihannic | #endregion |
20 | 5d673ce0 | Lucas Bihannic | |
21 | #region Méthodes |
||
22 | public Journee GetCurrentDay() |
||
23 | { |
||
24 | DateTime today = DateTime.Today; |
||
25 | return Journees.FirstOrDefault(j => j.Date.Date == today); |
||
26 | } |
||
27 | 09d4a0de | lbihannic | public PhaseCalibration GetCurrentPhase() |
28 | { |
||
29 | 1019554c | lbihannic | return GetCurrentDay().GetCurrentPhase(); |
30 | } |
||
31 | public Serie GetCurrentSet() |
||
32 | { |
||
33 | return GetCurrentDay().GetCurrentSet(); |
||
34 | 09d4a0de | lbihannic | } |
35 | 5d673ce0 | Lucas Bihannic | #endregion |
36 | 65ad7e66 | Lucas Bihannic | } |
37 | } |