Statistiques
| Branche: | Révision:

root / GES_PAC / ViewModel / ChambersViewModel.cs @ master

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

1
using GES_PAC.Model;
2
using GES_PAC.View;
3
using System.Windows.Input;
4

    
5
namespace GES_PAC.ViewModel
6
{
7
    public class ChambersViewModel : BaseViewModel
8
    {
9

    
10
        #region Attributs
11
        #endregion
12

    
13
        #region Commandes
14
        public ICommand OnClickChamberCommand { get; }
15
        #endregion
16

    
17
        #region Propriétés
18

    
19
        #endregion
20

    
21
        #region Constructeurs
22
        public ChambersViewModel()
23
        {
24
            OnClickChamberCommand = new Command<string>(async (idStr) =>
25
            {
26
                int id = int.Parse(idStr);
27
                await GoToEnterAnimal(id);
28
            });
29

    
30
        }
31
        #endregion
32

    
33
        #region Méthodes
34
        private async Task GoToEnterAnimal(int id)
35
        {
36
            IsBusy = true;
37
            await Shell.Current.GoToAsync($"{nameof(EnterAnimalView)}?chamberId={id}");
38
            IsBusy = false;
39
        }
40
        #endregion
41
    }
42
}