WPF Validation.HasError reverse inherited?
linking to this...
Just a curious question (due to lack of .Net developement environment on my machine), is 开发者_JS百科Validation.HasError
reverse inherited as in if a child element is in error will Validation.HasError
be true for its parent and thus for the entire window as well?
If not why? Anyways Validation.Error
is a bubbling routed event. So wouldn't it have been easier for WPF to set the value HasError
as true for the hierachy upwards?
Validation.Error is attached property, it is set only for certain FrameworkElement instance
Thanks to this we can create error style for failed FrameworkElement, not always developers need to mark window failed when inner FrameworkElement is failed
精彩评论