开发者

Silverlight validation - Automatically show validation message

I finally got validation working with MVVM in my Silverlight app. Now I'm wondering 开发者_运维技巧if there is a way to show the validation message that pops up to the right automatically without having to first click inside the textbox. The red border shows up, but it would be nice if the message was there as well. Any ideas?


You can edit the textbox's template to change how / where validation errors are shown. The default textbox template has them in a tooltip, you could, for instance move that to a label or textblock.


For an example of how to conveniently show it in a tooltip, check my blog post: Taking data binding, validation and MVVM to the next level - part 1

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜