Statistiques
| Branche: | Révision:

root / GES_PAC / ViewModel / MainViewModel.cs @ 9fd69a0e

Historique | Voir | Annoter | Télécharger (859 octets)

1
using GES_PAC.Services;
2
using GES_PAC.View;
3

    
4
namespace GES_PAC.ViewModel
5
{
6
    public class MainViewModel : BaseViewModel
7
    {
8
        #region Services
9
        private readonly ConnexionService connService;
10
        #endregion
11

    
12
        #region Commandes
13
        public Command GoToCreateDayCommand { get; }
14
        #endregion
15

    
16
        #region Constructeur
17
        public MainViewModel(ConnexionService connService)
18
        {
19
            this.connService = connService;
20
            GoToCreateDayCommand = new Command(async () => await GoToCreateDayPage());
21
        }
22
        #endregion
23

    
24
        #region Méthodes
25
        private async Task GoToCreateDayPage()
26
        {
27
            if (IsBusy) return;
28
            IsBusy = true;
29
            await Shell.Current.GoToAsync(nameof(CreateDayView));
30
            IsBusy = false;
31
        }
32
        #endregion
33
    }
34
}