I have a supposedly simple problem but I am not sure how to implement this. I have created a simple example of the issue with the below attached files. The two files are the ProductWindow xaml and cs file and the Product class file. I want to accomplish two things, please take a look at both and provide the code with your suggestion, thanks.
1) Limit the selected Items in the listbox to 3. How do I implement this for the listbox lbProducts? I didnt see a maxselecteditems property?!? or something similar.
2) This is a little more fun :) the second issue is I add the "All" Item to the datatable before binding the listbox. I would like to unselect other items if the All option is selected by the user and similarly unselect All if the user selected any other item. Also All should clear out the other selected items and we should limit the selected items to 3 only if All is not in the selected items? Hopefully that makes sense, please let me know if you need any other info, your help is really appreciated. Please take the code from my simple example files below.