Révision 42456640 GES_PAC/ViewModel/ChambersViewModel.cs

Voir les différences:

GES_PAC/ViewModel/ChambersViewModel.cs
1
using GES_PAC.Model;
2
using GES_PAC.Services;
1 3
using GES_PAC.View;
2 4
using GES_PAC.ViewModel.Controls;
3 5
using System.Collections.ObjectModel;
......
11 13
        #endregion
12 14

  
13 15
        #region Commandes
16
        public Serie? CurrentSet { get; set; }
14 17
        public ICommand TerminateSetCommand { get; }
15 18
        #endregion
16 19

  
17 20
        #region Propriétés
18
        public ObservableCollection<ChamberButtonViewModel> Chambers { get; } = new();
19 21
        public TimerPublisher Timer { get; }
20 22
        #endregion
21 23

  
......
24 26
        {
25 27
            TerminateSetCommand = new Command(async () => await TerminateSet());
26 28

  
29
            CurrentSet = JourneeViewModel.Instance.GetCurrentSet();
30

  
27 31
            Timer = new TimerPublisher();
28 32
            Timer.Start();
29 33
        }
......
37 41
            await Shell.Current.GoToAsync(nameof(EndSetView));
38 42
            IsBusy = false;
39 43
        }
44

  
45
        internal async void OnAppearing()
46
        {
47
            CurrentSet = JourneeViewModel.Instance.GetCurrentSet();
48
            if (CurrentSet == null)
49
            {
50
                IsBusy = true;
51
                await Shell.Current.GoToAsync(nameof(MainView));
52
                IsBusy = false;
53
            }
54
        }
40 55
        #endregion
41 56
    }
42 57
}

Formats disponibles : Unified diff