Révision 9601eaf0 GES_PAC/ViewModel/Controls/ChamberButtonViewModel.cs

Voir les différences:

GES_PAC/ViewModel/Controls/ChamberButtonViewModel.cs
14 14
        private bool _buttonIsEnabled;
15 15
        private string _buttonLabel;
16 16
        private string _timeIn;
17
        private Color _timeColor;
17 18
        private ICommand _onClickChamberCommand;
18 19
        private readonly TimerPublisher _timer;
19 20

  
......
80 81
            {
81 82
                _timeIn = value;
82 83
                OnPropertyChanged();
84

  
85
            }
86
        }
87
        public Color TimeColor
88
        {
89
            get => _timeColor;
90
            set
91
            {
92
                _timeColor = value;
93
                OnPropertyChanged();
83 94
            }
84 95
        }
85 96
        public SerieAnimal? AnimalSet;
......
156 167
            ButtonIsEnabled = !AnimalSet.IsOut;
157 168
            ButtonBackgroundColor = AnimalSet.HasBehaviour() ? Colors.Yellow : Colors.LightGreen;
158 169
            ButtonLabel = measureCount.ToString();
159
            TimeIn = AnimalSet.GetTimeInChamber();
170
            TimeIn = AnimalSet.GetFormatedTimeInChamber();
171
            TimeColor = AnimalSet.IsTimeWarning() ? Colors.Red : Colors.Black;
160 172
        }
161 173

  
174

  
162 175
        private async Task GoToChamber()
163 176
        {
164 177
            if (IsBusy) return;
......
172 185
        }
173 186
        public void OnTimerTick(object? sender, EventArgs e)
174 187
        {
175
            TimeIn = AnimalSet?.GetTimeInChamber() ?? "";
188
            TimeIn = AnimalSet?.GetFormatedTimeInChamber() ?? "";
189
            TimeColor = AnimalSet?.IsTimeWarning() ?? false ? Colors.Red : Colors.Black;
176 190
        }
177 191

  
178 192
        #endregion

Formats disponibles : Unified diff