sicpaconnexions / SICPA_Connexions / ViewModel / AnimalViewModel.cs @ 87e7d061
Historique | Voir | Annoter | Télécharger (1,632 ko)
1 |
using SICPA_Connexions.Model; |
---|---|
2 |
using SICPA_Connexions.View; |
3 |
using SICPA_Connexions.ViewModel.Base; |
4 |
using System; |
5 |
using System.Collections.Generic; |
6 |
using System.Collections.ObjectModel; |
7 |
using System.Linq; |
8 |
using System.Text; |
9 |
using System.Threading.Tasks; |
10 |
using System.Windows.Input; |
11 |
|
12 |
namespace SICPA_Connexions.ViewModel |
13 |
{ |
14 |
public class AnimalViewModel : BaseViewModel |
15 |
{ |
16 |
#region Attributs |
17 |
private string numRfid; |
18 |
private int poids; |
19 |
#endregion |
20 |
|
21 |
#region Commandes |
22 |
public ICommand EditionCommand { get; private set; } |
23 |
#endregion |
24 |
|
25 |
#region Propriétés |
26 |
public string NumRfid |
27 |
{ |
28 |
get { return numRfid; } |
29 |
set |
30 |
{ |
31 |
if (numRfid != value) |
32 |
{ |
33 |
numRfid = value; |
34 |
OnPropertyChanged(nameof(NumRfid)); |
35 |
} |
36 |
} |
37 |
} |
38 |
|
39 |
public int Poids |
40 |
{ |
41 |
get { return poids; } |
42 |
set |
43 |
{ |
44 |
if (poids != value) |
45 |
{ |
46 |
poids = value; |
47 |
OnPropertyChanged(nameof(Poids)); |
48 |
} |
49 |
} |
50 |
} |
51 |
|
52 |
|
53 |
#endregion |
54 |
|
55 |
#region Constructeurs |
56 |
public AnimalViewModel() |
57 |
{ |
58 |
EditionCommand = new Command(async () => await Edition()); |
59 |
} |
60 |
#endregion |
61 |
|
62 |
#region Méthodes |
63 |
private async Task Edition() |
64 |
{ |
65 |
IsBusy = true; |
66 |
await Task.Delay(1000); |
67 |
IsBusy = false; |
68 |
} |
69 |
#endregion |
70 |
|
71 |
} |
72 |
} |