Convert Tab's context flyout into a XAML control #10916

Open
opened 2026-01-31 02:33:39 +00:00 by claunia · 8 comments
Owner

Originally created by @leonMSFT on GitHub (Oct 6, 2020).

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.

Originally created by @leonMSFT on GitHub (Oct 6, 2020). 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.
claunia added the Issue-TaskProduct-TerminalArea-UserInterface labels 2026-01-31 02:33:39 +00:00
Author
Owner

@DHowett commented on GitHub (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 😄

@DHowett commented on GitHub (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 :smile:
Author
Owner

@leonMSFT commented on GitHub (Oct 6, 2020):

Damn, it's not as easy as exposing the MenuFlyoutItems in the IDL and just being like menuflyoutitem.Click{function}?

@leonMSFT commented on GitHub (Oct 6, 2020): _Damn_, it's not as easy as exposing the `MenuFlyoutItems` in the IDL and just being like `menuflyoutitem.Click{function}`?
Author
Owner

@leonMSFT commented on GitHub (Oct 6, 2020):

Oh nvm I see, you tried it out by only having a XAML file?

@leonMSFT commented on GitHub (Oct 6, 2020): Oh nvm I see, you tried it out by only having a XAML file?
Author
Owner

@DHowett commented on GitHub (Oct 9, 2020):

Yep. Just a XAML file w/ a flyout, then one with a usercontrol w/ a flyout, then then then

@DHowett commented on GitHub (Oct 9, 2020): Yep. Just a XAML file w/ a flyout, then one with a usercontrol w/ a flyout, then then then
Author
Owner

@mdtauk commented on GitHub (Oct 9, 2020):

Have you looked into using Xaml UserControls or CustomControls?

@mdtauk commented on GitHub (Oct 9, 2020): Have you looked into using Xaml UserControls or CustomControls?
Author
Owner

@DHowett commented on GitHub (Oct 9, 2020):

@mdtauk most of our project is UserControls or CustomControls.

@DHowett commented on GitHub (Oct 9, 2020): @mdtauk most of our project is UserControls or CustomControls.
Author
Owner

@mdtauk commented on GitHub (Oct 9, 2020):

@mdtauk most of our project is UserControls or CustomControls.

Fair enough then lol

@mdtauk commented on GitHub (Oct 9, 2020): > @mdtauk most of our project is UserControls or CustomControls. Fair enough then lol
Author
Owner

@zadjii-msft commented on GitHub (Oct 9, 2020):

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.

@zadjii-msft commented on GitHub (Oct 9, 2020): 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10916