开发者

Silverlight listbox validation: required selection

开发者 https://www.devze.com 2023-02-24 11:41 出处:网络
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 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

精彩评论

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