C#C
C#3y ago
Elio

❔ Display error message if value out of limit

Hi, i'm using wpf with mvvm pattern and i'd like to know if it's good to do this in order to display a message error if the value enter isn't good :
public class StepNormalViewModel : StepViewModel
    {
        private readonly StepNormal _stepNormal;

        private double _aV;
        public double AV
                {
                    get => _aV;
                    set
                    {
                        if(StepCheck.CheckAV(_aV))
                        {
                            _stepNormal.AV = _aV;
                            _aV = value;
                            OnPropertyChanged();
                        }
                        else
                        {
                            //*Display my Error forms*
                        }
                    }
                }
}
Was this page helpful?