开发者

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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜