-
Notifications
You must be signed in to change notification settings - Fork 330
Adding New Tabs
There are a couple of mechanisms to help you add a new tab; choose the mechanism most appropriate for your application.
There is a routed command, which, if executed will add a new tab. Before you use this you should be aware of TabablzControl.NewItemFactory
. The client code should provide a Func
which creates the content for each new tab item. This could be a view model (you would have DataTemplate available in your XAML) or a DragablzItem.
There are two ways of invoking your NewItemFactory
via AddItemCommand
:
This is the easiest way to add new tabs; it will cause the standard themes to show an "add" button. It can be set in XAML like so:
<TabablzControl ShowDefaultAddButton="True" />
It is possible to execute the command from your own button (typically within the TabablzControl).
<Button Command="{x:Static dragablz:TabablzControl.AddItemCommand}" />
The static AddItem
method can be called via code to add a new tab item. The arguments allow you to control where the item should appear (as there maybe multiple active Windows/docks).