In This Article

Backstage Class

Represents a Backstage application menu control, similar to the application menu introduced in Office 2010.

[TemplatePart(Name = "PART_CloseBackstageButton", Type = typeof(Button))]
public class Backstage : TabControl, IKeyTipTarget
Inheritance:
object Visual UIElement FrameworkElement Control ItemsControl Selector TabControl object
Implements:
IKeyTipTarget

Remarks

For detailed documentation on this control's features and how to use them, please see the ApplicationMenu documentation topic.

Constructors

Backstage()

Initializes an instance of the class.

public Backstage()

Properties

CanClose

Gets or sets whether the Backstage close button should be visible, and whether Esc can close Backstage.

public bool CanClose { get; set; }

Property Value

bool:

true if the Backstage close button should be visible, and whether Esc can close Backstage; otherwise, false. The default value is true.

Remarks

This feature is useful for scenarios where there is no document open in the main window yet, and Backstage is open, allowing for an end user to select a new document or open a document. In this scenario, you don't want the end user to be able to close Backstage until they take some action.

CloseCommand

Gets the ICommand that can close the Backstage.

public ICommand CloseCommand { get; }

Property Value

ICommand:

The ICommand that can close the Backstage.

IsCloseButtonVisible

Gets whether the close button is visible.

public bool IsCloseButtonVisible { get; }

Property Value

bool:

true if the close button is visible.

KeyTipAccessText

Gets or sets the key tip access text for the control.

[Localizability(LocalizationCategory.Text)]
public string KeyTipAccessText { get; set; }

Property Value

string:

The key tip access text for the control.

TitleBarHeight

Gets or sets the height of the title bar, by which to shift down Backstage content.

public double TitleBarHeight { get; set; }

Property Value

double:

The height of the title bar, by which to shift down Backstage content.

Methods

GetContainerForItemOverride()

Creates or identifies the element used to display the specified item.

protected override DependencyObject GetContainerForItemOverride()

Returns

DependencyObject:

The element that is used to display the given item.

IsItemItsOwnContainerOverride(object)

Determines if the specified item is (or is eligible to be) its own item container.

protected override bool IsItemItsOwnContainerOverride(object item)
Parameter Type Description
item object

Specified item.

Returns

bool:

true if the item is its own item container; otherwise, false.

OnCreateAutomationPeer()

Creates and returns an AutomationPeer object for this type.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

The AutomationPeer that was created.

OnInitialized(EventArgs)

Occurs after the control has been initialized.

protected override void OnInitialized(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

OnItemsChanged(NotifyCollectionChangedEventArgs)

Invoked when the Items property changes.

protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameter Type Description
e NotifyCollectionChangedEventArgs

A NotifyCollectionChangedEventArgs that contains the event data.

OnKeyDown(KeyEventArgs)

Invoked when an unhandled Keyboard.KeyDownEvent attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

protected override void OnKeyDown(KeyEventArgs e)
Parameter Type Description
e KeyEventArgs

A KeyEventArgs that contains the event data.

OnKeyTipAccessed(string)

Called when key tip access text for the control is typed by the end user.

protected virtual bool OnKeyTipAccessed(string keyTipAccessText)
Parameter Type Description
keyTipAccessText string

The key tip access text that was typed.

Returns

bool:

true if an action was executed that should stop key tip mode; otherwise, false.

Remarks

Implementations of this method should either execute the action associated with the control or move focus to the control so that the end user can take further action such as in a menu.

Fields

CanCloseProperty

Identifies the CanClose dependency property. This field is read-only.

public static readonly DependencyProperty CanCloseProperty

IsCloseButtonVisibleProperty

Identifies the IsCloseButtonVisible dependency property. This field is read-only.

public static readonly DependencyProperty IsCloseButtonVisibleProperty

KeyTipAccessTextProperty

Identifies the KeyTipAccessText dependency property. This field is read-only.

public static readonly DependencyProperty KeyTipAccessTextProperty

TitleBarHeightProperty

Identifies the TitleBarHeight dependency property. This field is read-only.

public static readonly DependencyProperty TitleBarHeightProperty