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