root / GES_PAC / ViewModel / JourneeViewModel.cs @ 09d4a0de
Historique | Voir | Annoter | Télécharger (1,025 ko)
1 |
using GES_PAC.Model; |
---|---|
2 |
using System; |
3 |
using System.Collections.Generic; |
4 |
using System.Collections.ObjectModel; |
5 |
using System.Linq; |
6 |
using System.Text; |
7 |
using System.Threading.Tasks; |
8 |
|
9 |
namespace GES_PAC.ViewModel |
10 |
{ |
11 |
public class JourneeViewModel |
12 |
{ |
13 |
#region Attributs |
14 |
private static JourneeViewModel _instance; |
15 |
#endregion |
16 |
|
17 |
#region Propriétés |
18 |
public ObservableCollection<Journee> Journees { get; set; } = new(); |
19 |
public static JourneeViewModel Instance => _instance ??= new JourneeViewModel(); |
20 |
#endregion |
21 |
|
22 |
#region Constructeurs |
23 |
private JourneeViewModel() { } |
24 |
#endregion |
25 |
|
26 |
#region Méthodes |
27 |
public Journee GetCurrentDay() |
28 |
{ |
29 |
DateTime today = DateTime.Today; |
30 |
return Journees.FirstOrDefault(j => j.Date.Date == today); |
31 |
} |
32 |
public PhaseCalibration GetCurrentPhase() |
33 |
{ |
34 |
var journeeActuelle = GetCurrentDay(); |
35 |
return journeeActuelle.GetCurrentPhase(); |
36 |
} |
37 |
#endregion |
38 |
} |
39 |
} |