
I am struggling to have a splitbutton in the QAT that has a dynamic menu in it, I have tried two approaches:
1. Bind the ItemsSource on the Menu to a list of Commands (and using a datatemplate to add buttons for each command). The list of commands changes depending on what our GUI is showing.
2. Use the PopupOpening event on the SplitButton to dynamically populate the Menu (using the same list of commands) when you open it.
My problem is that when you remove and add this type of splitbutton from and to the QAT it seems that a clone of the button and the menu is made and after that the binding in attempt 1 stops working and also the eventhandler in attempt 2 stops working.
Any idea to work around this problem?
Thanks
Magnus
1. Bind the ItemsSource on the Menu to a list of Commands (and using a datatemplate to add buttons for each command). The list of commands changes depending on what our GUI is showing.
2. Use the PopupOpening event on the SplitButton to dynamically populate the Menu (using the same list of commands) when you open it.
My problem is that when you remove and add this type of splitbutton from and to the QAT it seems that a clone of the button and the menu is made and after that the binding in attempt 1 stops working and also the eventhandler in attempt 2 stops working.
Any idea to work around this problem?
Thanks
Magnus