An Hoa
An Hoa

Reputation: 1267

Edge-like tab bar in XAML for universal app

Is there a good way to achieve similar dynamic tab in XAML like in Edge browser where tabs are added dynamically? I know that the Pivot can be used for static tabs. More specifically, I need a solution that accounts for situation when there are too many tabs.

Upvotes: 1

Views: 804

Answers (2)

GustavoTM
GustavoTM

Reputation: 505

The Windows Community Toolkit now offer support of this control: Tabs

The documentation for this new controls is located here: https://learn.microsoft.com/en-us/dotnet/api/microsoft.toolkit.uwp.ui.controls.tabview?view=win-comm-toolkit-dotnet-stable

And some code samples are located here: https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/TabView

Upvotes: 1

Shafiq Abbas
Shafiq Abbas

Reputation: 98

An Hoa,

Follow these,

  1. Create a grid with two row definitions.
  2. First row definition is to create controls like enter image description here

  3. Second row definition is to create a empty layout.

  4. In the first row definition, create a stack panel and add a grid inside it with textblock to display the website name for ex.
  5. Create a + button.
  6. On click of + button, create a same grid with text block and add the control as child element to the stack panel which is present inside the first row definition.
  7. Follow the same for empty layout also which is present in the second row definition.

Upvotes: 2

Related Questions