wpf - How to bind non-existing IsEmpty property of listbox? -
i have form , button should enabled if listbox not empty. how can binding case?
note: avoid creating custom converter.
thanks!
multiple options,
- if you're using mvvm pattern - viewmodel expose shouldshowdetails property, checks itemcount (visualized listbox) , returns boolean. bind enabled properties of dependent controls property. (recommended)
- write trigger on dependent controls - resets enabled property if value of listbox's itemcount property 0.
- write itemcount boolean converter , bind listbox's itemcount property directly
Comments
Post a Comment