Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to draw default silverlight invalid control state around custom control?

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.

like image 373
v00d00 Avatar asked Jan 23 '26 14:01

v00d00


1 Answers

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.

like image 171
herzmeister Avatar answered Jan 26 '26 02:01

herzmeister



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!