I am making pretty simple custom control which only combines several other default controls together with some custom logic.
Errors from INotifyDataError interfaces are not displaying on my control. As far as I can see the common practice to display validation errors on custom control is to implement several visual states on it and switch them when receiving bound data.
But to be honest I hate to work with this stuff and whole UI part.
Is there a way to display default rectangular invalid state around the square content? For example it would be great to inherit from such control or to use it as the content presenter with switchable states.
Did you look at the DataForm control from the Silverlight Toolkit? You can place your complete custom control layout in its EditTemplate.
Other than that, you might be lucky with the static VisualStateManager.GoToState(Control control, string stateName, bool useTransitions) method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With