I have a Button
inside a MenuItem.Header
like this:
<Menu>
<MenuItem>
<MenuItem.Header>
<Button>Hello</Button>
</MenuItem.Header>
<MenuItem Header="SubItem1"/>
<MenuItem Header="SubItem2"/>
</MenuItem>
</Menu>
if I click the MenuItem
outside the Button
, the sub-menu opens. But if I click the Button
the sub-menu will not open. I believe that's because the event of the clicked is not passed to the MenuItem
. How do I fix it?
In short - I want the sub-menu to open when clicking the Button
.
(The use is mainly for styling purposes, I have a button style and I want to use it as a MenuItem
)