Passing state of WPF ValidationRule to View Model in MVVM

前端 未结 9 1724
难免孤独
难免孤独 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:40

    Someone's solved it here (unfortunately its in VB) by creating a dependency property HasError in the VM which seems to be bound to the Validation.HasError. I don't completely understand it yet but it may help you:

    http://wpfglue.wordpress.com/2009/12/03/forwarding-the-result-of-wpf-validation-in-mvvm/

提交回复
热议问题