Passing state of WPF ValidationRule to View Model in MVVM

前端 未结 9 1743
难免孤独
难免孤独 2021-01-01 20:10

I am stuck in a seemingly common requirement. I have a WPF Prism (for MVVM) application. My model implements the IDataErrorInfo for validation. The

9条回答
  •  清歌不尽
    2021-01-01 20:42

    I have the same problem with you, but I solve in another way, I use the Triggers to disable the button when the input is invalid. Meanwhile, the textbox binding should use ValidatesOnExceptions=true