Skip to end of metadata
Go to start of metadata

Remarks

UXRibbonTab is inherited from ISHeaderedItemsControl which means this control has a header and collection of items that represent the control. There are two types of item that you can declare in UXRibbonTab which are UXRibbonTabGroup and UXRibbonTabOrderedGroup. Each group has different behaviors and configurations that you can use to organize your commands.

The following code shows how to define simple ribbon tabs.

XAML

To learn more about UXRibbonTab, see Understanding UXRibbonTab.

Working with ContextualTabGroupName Property

Contextual tab is a unique ribbon concept that defines the tab's visibility based on a specific context. The contextual tab is useful to hide application commands that are irrelevant unless certain context is available. For example, you can design the ribbon to show the search related commands when the search textbox is focused, such as shown in the illustration below.

To use contextual tab in UXRibbonBar, you need to configure several things as follows:

The following code shows how to configure the contextual tabs and set the active contextual tab initially.

XAML

The result looks like the following figure.

When the contextual tab group is activated, you can customize the AutoSelectMode behavior to further enhance the user experience.

  • Always
    When the contextual tab group is active, the first tab in the collection will be selected by default.

  • Disabled
    Automatic tab selection is disabled.

  • LastSelection
    When the contextual tab group is active, the previously selected tab will be reselected by default.

To learn more about UXRibbonContextualTabGroup, see Working with Contextual Tab.

Working with ResizeOrder Property

By default UXRibbonBar will resize the groups from last to first order if the ResizeOrder property is not set. The ResizeOrder property allows you to choose which group you want to resize first according to the resize order. You can also set the resize order in either unpatterned or patterned order. When it reaches the end of the order, it will cycle back to the first order.

The following code shows how to specify ResizeOrder in unpatterned/exact order.

XAML

The result looks like the following figure.

Default
Step 1
Step 2
Step 3
Step 4
Step 5
Step 6

To learn more about ResizeOrder, see Customizing Fluent Resizing Behaviors in UXRibbonBar.

Definition

public class UXRibbonTab : ISHeaderedItemsControl, IRibbonKeyTipAction

Summary

The following table summarizes the members exposed in this class.

Public Constructors

UXRibbonTab Constructor()Creates a new instance of UXRibbonTab class.

Public Properties

ActiveBorderBrushGets or sets a value that specifies the border brush when tab is active.
AnimationBackgroundGets or sets a value that specifies the animation background.
AnimationBorderBrushGets or sets a value that specifies the animation border brush.
ContextualTabGroupNameGets or sets a value that specifies the contextual group name relation.
HeaderDisplayModeGets or sets a value that determines the header display mode.
HeaderImageGets or sets a value that specifies the image image.
HeaderImageStretchGets or sets a value that specifies the image stretch.
ImageHeightGets or sets a value that specifies the image height.
ImageWidthGets or sets a value that specifies the image width.
ResizeOrderGets or sets a value that determines the order of the groups when resizing is performed due to insufficient space.
TextImageRelationGets or sets a value that determines the text and image relation.

Protected Properties

ProductProduct Info.

Fields

ActiveBorderBrushPropertyIdentifies the ActiveBorderBrush dependency property.
AnimationBackgroundPropertyIdentifies the AnimationBackground dependency property.
AnimationBorderBrushPropertyIdentifies the AnimationBorderBrush dependency property.
ContextualTabGroupNamePropertyIdentifies the ContextualTabGroupName dependency property.
HeaderDisplayModePropertyIdentifies the HeaderDisplayMode dependency property.
HeaderImagePropertyIdentifies the HeaderImage dependency property.
HeaderImageStretchPropertyIdentifies the HeaderImageStretch dependency property.
ImageHeightPropertyIdentifies the ImageHeight dependency property.
ImageWidthPropertyIdentifies the ImageWidth dependency property.
ResizeOrderPropertyIdentifies the ResizeOrder dependency property.
TextImageRelationPropertyIdentifies the TextImageRelation dependency property.

Public Methods

AttachEventHandlers()Attach built-in event handlers to control templates. Call this method if necessary.
DetachedEventHandlers()Detach built-in event handlers from control templates. Call this method if necessary.
Dispose() 
InitializeTemplates()Initializes control templates.
OnApplyTemplate()When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call System.Windows.Controls.Control.ApplyTemplate(). In simplest terms, this means the method is called just before a UI element displays in an application. For more information, see Remarks.
RaiseAction()Raise the action in element that implements IRibbonKeyTipAction.

Protected Methods

ApplyStyle(DependencyObject, object) 
ChangeVisualState(bool)Called when the control's visual state is changed.
OnIsSelectedChanged(bool, bool)Called when the IsSelected property is changed.

Public Constructors

public UXRibbonTab()

Creates a new instance of UXRibbonTab class.

Public Properties

public Brush ActiveBorderBrush { get; set; }

Gets or sets a value that specifies the border brush when tab is active.

public Brush AnimationBackground { get; set; }

Gets or sets a value that specifies the animation background.

public Brush AnimationBorderBrush { get; set; }

Gets or sets a value that specifies the animation border brush.

public string ContextualTabGroupName { get; set; }

Gets or sets a value that specifies the contextual group name relation.

public ContentType HeaderDisplayMode { get; set; }

Gets or sets a value that determines the header display mode.

public ImageSource HeaderImage { get; set; }

Gets or sets a value that specifies the image image.

public Stretch HeaderImageStretch { get; set; }

Gets or sets a value that specifies the image stretch.

public double ImageHeight { get; set; }

Gets or sets a value that specifies the image height.

public double ImageWidth { get; set; }

Gets or sets a value that specifies the image width.

public ObservableCollection<string> ResizeOrder { get; set; }

Gets or sets a value that determines the order of the groups when resizing is performed due to insufficient space.

public TextImageRelation TextImageRelation { get; set; }

Gets or sets a value that determines the text and image relation.

Protected Properties

protected ProductInfo Product { get; }

Product Info.

Fields

public static readonly DependencyProperty ActiveBorderBrushProperty

Identifies the ActiveBorderBrush dependency property.

public static readonly DependencyProperty AnimationBackgroundProperty

Identifies the AnimationBackground dependency property.

public static readonly DependencyProperty AnimationBorderBrushProperty

Identifies the AnimationBorderBrush dependency property.

public static readonly DependencyProperty ContextualTabGroupNameProperty

Identifies the ContextualTabGroupName dependency property.

public static readonly DependencyProperty HeaderDisplayModeProperty

Identifies the HeaderDisplayMode dependency property.

public static readonly DependencyProperty HeaderImageProperty

Identifies the HeaderImage dependency property.

public static readonly DependencyProperty HeaderImageStretchProperty

Identifies the HeaderImageStretch dependency property.

public static readonly DependencyProperty ImageHeightProperty

Identifies the ImageHeight dependency property.

public static readonly DependencyProperty ImageWidthProperty

Identifies the ImageWidth dependency property.

public static readonly DependencyProperty ResizeOrderProperty

Identifies the ResizeOrder dependency property.

public static readonly DependencyProperty TextImageRelationProperty

Identifies the TextImageRelation dependency property.

Public Methods

public void AttachEventHandlers()

Attach built-in event handlers to control templates. Call this method if necessary.

public void DetachedEventHandlers()

Detach built-in event handlers from control templates. Call this method if necessary.

public void Dispose()

 

public void InitializeTemplates()

Initializes control templates.

public void OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call System.Windows.Controls.Control.ApplyTemplate(). In simplest terms, this means the method is called just before a UI element displays in an application. For more information, see Remarks.

public void RaiseAction()

Raise the action in element that implements IRibbonKeyTipAction.

Protected Methods

protected void ApplyStyle(DependencyObject element, object item)

 

Parameters

element 
item 

 

protected void ChangeVisualState(bool useTransitions)

Called when the control's visual state is changed.

Parameters

useTransitionsDetermines whether transitions should be applied.

 

protected void OnIsSelectedChanged(bool oldValue, bool newValue)

Called when the IsSelected property is changed.

Parameters

oldValue 
newValue 
  • No labels