Skip to end of metadata
Go to start of metadata

Remarks

UXRibbonQuickAccessToolbar is a ribbon-friendly control that provides quick access to frequently accessed commands such as New, Open, Save and Print. You can hide the commands initially by setting the Visibility property to Collapsed. At runtime, users can show the hidden commands through the dropdown menu in the quick access toolbar.

By default, the position of UXRibbonQuickAccessToolbar is set to the top of UXRibbonBar. If you prefer, you can set the position to the bottom by setting the ToolBarPosition property to Bottom.

UXRibbonQuickAccessToolbar derives from UXToolbar which is an advanced, rich-featured toolbar control with elegant built-in styles and built-in support for various button types such as described below.

  • Button
    Represents a standard command button.

  • DropdownButton
    Represents a button that displays dropdown menu when clicked, which can contain a collection of menu items and nested menu items similar to UXContextMenu.

  • SplitButton
    Represents a combination of command button and a dropdown menu. This type of button typically provides users with a default command that executed when the command part of the button is clicked, while at the same time allowing users to choose alternative commands through the dropdown arrow. Similar to the DropdownButton, you can also define a collection of menu items and nested menu items as in UXContextMenu.

  • Custom
    Represents a custom button that can be used to contain any UIElement or controls. With this type, the default layout properties such as margin and padding as well as the UI behaviors would be disabled. Consequently, this type is ideal to host custom controls such as text box, combo box, date picker and others.

The following code shows how to add UXRibbonQuickAccessToolbar to the ribbon control with several buttons using different button type.

XAML

The result looks like the following figure.

To learn more about UXRibbonQuickAccessToolBar, see Working with Ribbon Quick Access Toolbar.

Using Commands in Quick Access Toolbar

The following example shows how to assign a command to a UXRibbonToolBarButton which will be executed when the item is pressed.

XAML

For more information about the basics of commanding concept, see Commanding Overview.

Definition

public class UXRibbonQuickAccessToolBar : UXToolBar

Summary

The following table summarizes the members exposed in this class.

Public Constructors

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

Public Properties

CanUserCustomizeGets or sets a value that determines whether users can customize the toolbar at runtime.
ToolBarPositionGets or sets a value that determines the toolbar position whether below or above the ribbon.

Protected Properties

ProductProduct Info.

Fields

CanUserCustomizePropertyIdentifies the CanUserCustomize dependency property.
ToolBarPositionPropertyIdentifies the RibbonToolBarPosition dependency property.

Public Methods

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.

Protected Methods

OnItemsChanged(NotifyCollectionChangedEventArgs)Called when the value of the System.Windows.Controls.ItemsControl.Items property changes.

Public Constructors

public UXRibbonQuickAccessToolBar()

Creates a new instance of UXRibbonQuickAccessToolBar class.

Public Properties

public bool CanUserCustomize { get; set; }

Gets or sets a value that determines whether users can customize the toolbar at runtime.

public RibbonToolBarPosition ToolBarPosition { get; set; }

Gets or sets a value that determines the toolbar position whether below or above the ribbon.

Remarks

By default, the position of UXRibbonQuickAccessToolBar is set to the top of UXRibbonBar. If you prefer, you can set the position to the bottom by setting the UXRibbonQuickAccessToolBar property to Bottom. To learn more about UXRibbonQuickAccessToolBar, see Working with Ribbon Quick Access Toolbar.

 

Protected Properties

protected ProductInfo Product { get; }

Product Info.

Fields

public static readonly DependencyProperty CanUserCustomizeProperty

Identifies the CanUserCustomize dependency property.

public static readonly DependencyProperty ToolBarPositionProperty

Identifies the RibbonToolBarPosition dependency property.

Public Methods

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.

Protected Methods

protected void OnItemsChanged(NotifyCollectionChangedEventArgs e)

Called when the value of the System.Windows.Controls.ItemsControl.Items property changes.

Parameters

eA System.Collections.Specialized.NotifyCollectionChangedEventArgs that contains the event data.
  • No labels