You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am facing InputValidation right now in WPF when using mvvmgen and wondering about why this feature isn't part of mvvmgen.
But i also read your discussion on ms-ui-xaml post and understand why you are not implementing this feature before ms implement the framework for this in win ui.
In the meantime. Do you have a suggestion for inputValidation in WPF in 2022?
yes, exactly, WinUI is the reason it's not here yet, but seems that the WinUI team is not making much progress on this one.
The approach for WPF is to implement INotifyPropertyChanged for input validation.
With mvvmgen, you could create a ValidationViewModelBase class that inherits from MvvmGen's ViewModelBase class. Then you implement the INotifyPropertyChanged interface on ValidationViewModelBase and you inherit your ViewModels that require validation from that new ValidationViewModelBase. To do that, you usually override the OnPropertyChanged method and from there you call a Validate method to add or remove errors per property (that you have to store in a dictionary).
MvvmGen should support an easy way to implement input validation with the
INotifyDataErrorInfo
interface.ValidationViewModelBase
class is something that could make sense.Note: This issue might make sense when WinUI gets its input validation done: microsoft/microsoft-ui-xaml#179
The text was updated successfully, but these errors were encountered: