Replies: 4 comments 1 reply
-
I tried reading the source code of menu and menubase, but I don't even understand how it actually pops up something. |
Beta Was this translation helpful? Give feedback.
-
There is |
Beta Was this translation helpful? Give feedback.
-
Wait, sorry, I got totally confused. The menu class is actually implementing a menu bar, inside which we need to place one menuitem per menu, which are the ones with the events. |
Beta Was this translation helpful? Give feedback.
-
I was actually testing with a RibbonMenuButton (inheriting from Menu suggesting Menu was really a menu, not a menu bar) which contains a popup that does the job, and its opening/closing events are actually forwarded to events on RibbonMenuButton. I was just looking in the wrong place, trying to write code that would work on a menu as well as a ribbonmenubutton. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like the items in a System.Windows.Controls.Menu to be regenerated everytime the user opens the menu. In windows forms, I could do it by handling an opening event to reassign the contents. But I can't find such an event in wpf.
I tried setting the item source to an enumerable whose getenumerator regenerates the contents everytime it is called. but it seems that itemsource is only evaluated once.
While I'm at it, is there a programmatic way to trigger the opening and closing of a menu? (That would be for automated tests.)
Beta Was this translation helpful? Give feedback.
All reactions