开发者

Silverlight listbox validation: required selection

I want to validate a ListBox: the user must select at least 2 items. The SelectedI开发者_StackOverflow中文版tems property doesn't support binding. So what now?

I miss the good old days when WinForms and ASP.NET controls had validation events, buttons had the CausesValidation property, etc...


You could probably handle the selected items changed event using a Trigger or Behaviour and then use the INotifyDataErrorInfo to create a validation errors for that control.

http://www.silverlightshow.net/items/Behaviors-and-Triggers-in-Silverlight-3.aspx

http://attachedwpf.com/blog/2010/03/24/silverlight-4-inotifydataerrorinfo/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜