Suggestion
Surface WinUI TabView's built-in add-tab button through the windows-reactor
TabView builder
TabView shows its own "+" button at the end of the tab strip by default, but
the reactor builder gives you no way to handle a click on it — you only get
on_selection_changed and on_tab_close_requested. So if you build a tab set
where users can add and close tabs, that built-in "+" just sits there doing
nothing, and you end up adding your own separate "Add" button somewhere else.
You can see this in the gallery's "Dynamic Tabs" sample: it drives the tab
count with two separate button("Add Tab") / button("Remove Tab") controls
underneath the TabView, rather than using the native "+" (and close) buttons
the control already draws.
Unless I'm wrong and such a way exists
Suggestion
Surface WinUI
TabView's built-in add-tab button through thewindows-reactorTabViewbuilderTabViewshows its own "+" button at the end of the tab strip by default, butthe reactor builder gives you no way to handle a click on it — you only get
on_selection_changedandon_tab_close_requested. So if you build a tab setwhere users can add and close tabs, that built-in "+" just sits there doing
nothing, and you end up adding your own separate "Add" button somewhere else.
You can see this in the gallery's "Dynamic Tabs" sample: it drives the tab
count with two separate
button("Add Tab")/button("Remove Tab")controlsunderneath the TabView, rather than using the native "+" (and close) buttons
the control already draws.
Unless I'm wrong and such a way exists