I have a button with an Image as its content in a toolbar. I would like this button to open a menu beneath it when clicked. How?
There are lots of ways to get this done and you might consider this approach...
This wraps your button into a MenuItem
that has a submenu. As shown here, the MenuItem
property called IsSubMenuOpen
is bound to a notifying property of type bool in your ViewModel called SomeProperty
.
You would have to have your ViewModel toggle this property depending upon what you are actually trying to do. You may want to consider making your button a toggle button so as to facilitate closing the submenu, otherwise you'll have to wire up additional behaviour in your ViewModel.