You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Convert Tab's context flyout into a XAML control #7841
Tabs currently create their context flyout menu items in a big create function. It would be nice to convert that into a custom XAML control so that the more menu items we decide to add to the flyout, the easier it will be to manage. We should also design it in a way where different types of tabs (i.e. SettingsUI tab vs TerminalTab) can choose what menu items they would like to use.
Funny enough, I tried to do this (just having the context menu in a .xaml file) and it was a total pain to hook up the event handlers without introducing another class just to implement the events that could come out of the context menu 😄
What if we just passed a ShortcutActionDispatch into the (theoretical) TabContextMenuControl? Then we could have the items in the flyout dispatch actions to that, routing them up to the Page as usual. We'll probably want that anyways, esp if we want to let users customize the content of that flyout.
Activity
DHowett commentedon Oct 6, 2020
Funny enough, I tried to do this (just having the context menu in a .xaml file) and it was a total pain to hook up the event handlers without introducing another class just to implement the events that could come out of the context menu 😄
leonMSFT commentedon Oct 6, 2020
Damn, it's not as easy as exposing the
MenuFlyoutItemsin the IDL and just being likemenuflyoutitem.Click{function}?leonMSFT commentedon Oct 6, 2020
Oh nvm I see, you tried it out by only having a XAML file?
DHowett commentedon Oct 9, 2020
Yep. Just a XAML file w/ a flyout, then one with a usercontrol w/ a flyout, then then then
mdtauk commentedon Oct 9, 2020
Have you looked into using Xaml UserControls or CustomControls?
DHowett commentedon Oct 9, 2020
Martin Anderson (@mdtauk) most of our project is UserControls or CustomControls.
mdtauk commentedon Oct 9, 2020
Fair enough then lol
zadjii-msft commentedon Oct 9, 2020
What if we just passed a
ShortcutActionDispatchinto the (theoretical)TabContextMenuControl? Then we could have the items in the flyout dispatch actions to that, routing them up to the Page as usual. We'll probably want that anyways, esp if we want to let users customize the content of that flyout.