Terminal: Bind TerminalPage's TabView to TerminalPage::_tabs

Created on 12 Dec 2019  路  3Comments  路  Source: microsoft/terminal

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.

Area-CodeHealth Issue-Task Needs-Tag-Fix Product-Terminal

Most helpful comment

(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:)

All 3 comments

(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:)

I'm yanking triage and scoping it into 1912. :smile:

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_

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrmlnc picture mrmlnc  路  3Comments

miniksa picture miniksa  路  3Comments

warpdesign picture warpdesign  路  3Comments

xmm1989218 picture xmm1989218  路  3Comments

carlos-zamora picture carlos-zamora  路  3Comments