BackstageTabControl
A custom class that provides a standalone Tab control that mimics the MS Office Backstage tab control system.
public class BackstageTabControl : TabControl
Inherits from / implements: TabControl
Remarks
How this control works. Like the rest of the Office family it carries no code beyond its properties: it is a TabControl with a template that lays the tab headers down the left as a menu and the selected tab's content to the right. Every setting here is read by that template through a FindAncestor binding, so a property added here does nothing until the template binds it. Every brush default is frozen. A dependency property's default is one object shared by every instance in the process. Left unfrozen, a caller who reaches a default brush and recolours it recolours every backstage view in the application - and a frozen brush is also cheaper to render, which matters for the radial gradient behind the selection. The menu's colours do not come from the system. The menu background defaults to a fixed light grey, so the text on it must default to a fixed dark colour rather than to the system's menu text colour: on a machine in a dark theme that colour is near-white and the menu would be white text on light grey. MenuItemForegroundBrush is the property to set when MenuBackgroundBrush is changed. A frozen default and an animation cannot both be had. The selected item's text colour is a second brush and a trigger, not an animation over the first brush's colour. An animation writes to whatever object the property points at, which for a dependency property's default is the one object the whole process shares - so it either changes every instance at once or, once that object is frozen, throws.
Members at a glance
HoverTabItemBackgroundBrush | Gets or sets the hover tab item background brush. |
HoverTabItemBorderBrush | Gets or sets the hover tab item border brush. |
MenuBackgroundBrush | Gets or sets the menu background brush. |
MenuBorderBrush | Gets or sets the menu border brush. |
MenuBorderThickness | Gets or sets the menu border thickness. |
MenuFontFamily | Gets or sets the menu font family. |
MenuFontSize | Gets or sets the size of the menu font. |
MenuItemForegroundBrush | Gets or sets the brush the menu item text is drawn in. |
MenuItemHeight | Gets or sets the height of the menu item. |
MenuItemSelectedForegroundBrush | Gets or sets the brush the selected menu item's text is drawn in. |
MenuItemSelectedStateBorderBrush | Gets or sets the menu item selected state border brush. |
MenuItemSelectedStateBorderThickness | Gets or sets the menu item selected state border thickness. |
MenuItemSelectedStateFillBrush | Gets or sets the menu item selected state fill brush. |
MenuItemSelectionPointerStemPathData | Gets or sets the menu item selection pointer stem path data. |
MenuItemWidth | Gets or sets the width of the menu item. |
HoverTabItemBackgroundBrushProperty | The hover tab item background brush property |
HoverTabItemBorderBrushProperty | The hover tab item border brush property |
MenuBackgroundBrushProperty | The menu background brush property |
MenuBorderBrushProperty | The menu border brush property |
MenuBorderThicknessProperty | The menu border thickness property |
MenuFontFamilyProperty | The menu font family property |
MenuFontSizeProperty | The menu font size property |
MenuItemForegroundBrushProperty | The menu item foreground brush property |
MenuItemHeightProperty | The menu item height property |
MenuItemSelectedForegroundBrushProperty | The menu item selected foreground brush property |
MenuItemSelectedStateBorderBrushProperty | The menu item selected state border brush property |
MenuItemSelectedStateBorderThicknessProperty | The menu item selected state border thickness property |
MenuItemSelectedStateFillBrushProperty | The menu item selected state fill brush property |
MenuItemSelectionPointerStemPathDataProperty | The menu item selection pointer stem path data property |
MenuItemWidthProperty | The menu item width property |
Properties
HoverTabItemBackgroundBrush
Gets or sets the hover tab item background brush.
Value. The hover tab item background brush.
HoverTabItemBorderBrush
Gets or sets the hover tab item border brush.
Value. The hover tab item border brush.
Fields
HoverTabItemBackgroundBrushProperty
The hover tab item background brush property
HoverTabItemBorderBrushProperty
The hover tab item border brush property