Bind TerminalPage's TabView to TerminalPage::_tabs #5516

Closed
opened 2026-01-31 00:15:14 +00:00 by claunia · 3 comments
Owner

Originally created by @leonMSFT on GitHub (Dec 11, 2019).

Originally assigned to: @leonMSFT on GitHub.

Currently, Tab is a regular C++ class. This gives us some annoying headaches when trying to tie Tabs to the UI. For example, as described in #2740, TerminalPage keeps track of two separate vectors of Tab that need to be kept in sync. There's one vector of TabViewItems specifically used by the TabView and another vector of <shared_ptr<Tab>>. Updating one requires an update on the other one.

This could be avoided by using an observable vector of Tab that's bound to the XAML control. However, this requires Tab to be converted to a WinRT class. This would also make future attempts to use Tab in XAML controls much easier. (such as in #1502)

EDIT: as of #4350, Tab has been converted into a WinRT type, and TerminalPage::_tabs has been converted to an IObservableVector. What's left is to bind TerminalPage's TabView to that vector.

Originally created by @leonMSFT on GitHub (Dec 11, 2019). Originally assigned to: @leonMSFT on GitHub. Currently, `Tab` is a regular C++ class. This gives us some annoying headaches when trying to tie `Tab`s to the UI. For example, as described in #2740, `TerminalPage` keeps track of two separate vectors of `Tab` that need to be kept in sync. There's one vector of `TabViewItems` specifically used by the `TabView` and another vector of `<shared_ptr<Tab>>`. Updating one requires an update on the other one. This could be avoided by using an observable vector of `Tab` that's bound to the XAML control. However, this requires `Tab` to be converted to a WinRT class. This would also make future attempts to use `Tab` in XAML controls much easier. (such as in #1502) EDIT: as of #4350, `Tab` has been converted into a WinRT type, and `TerminalPage::_tabs` has been converted to an `IObservableVector`. What's left is to bind `TerminalPage`'s TabView to that vector.
claunia added the Issue-TaskNeeds-Tag-FixProduct-TerminalArea-CodeHealth labels 2026-01-31 00:15:14 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Dec 11, 2019):

(minor warning callout to @mkitzan as well: he requested this on a recent code review, and we're officially booking team work on it. 😄)

@DHowett-MSFT commented on GitHub (Dec 11, 2019): (minor warning callout to @mkitzan as well: he requested this on a recent code review, and we're officially booking team work on it. :smile:)
Author
Owner

@DHowett-MSFT commented on GitHub (Dec 12, 2019):

I'm yanking triage and scoping it into 1912. 😄

@DHowett-MSFT commented on GitHub (Dec 12, 2019): I'm yanking triage and scoping it into 1912. :smile:
Author
Owner

@leonMSFT commented on GitHub (Jun 22, 2020):

Closing because we actually need access to the TabViewItem to perform some of our custom modifications like tab color and tab title boxes (and maybe future modifications), and so letting us have total control of our TabViewItems is needed, so this in fact is the way

@leonMSFT commented on GitHub (Jun 22, 2020): Closing because we actually need access to the TabViewItem to perform some of our custom modifications like tab color and tab title boxes (and maybe future modifications), and so letting us have total control of our TabViewItems is needed, so this in fact _is the way_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5516