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,

  1. if you're using mvvm pattern - viewmodel expose shouldshowdetails property, checks itemcount (visualized listbox) , returns boolean. bind enabled properties of dependent controls property. (recommended)
  2. write trigger on dependent controls - resets enabled property if value of listbox's itemcount property 0.
  3. write itemcount boolean converter , bind listbox's itemcount property directly

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -