In This Article

NavigationBar Class

Represents a navigation bar control.

[TemplatePart(Name = "PART_ContentArea", Type = typeof(UIElement))]
[TemplatePart(Name = "PART_Splitter", Type = typeof(NavigationBarSplitter))]
public class NavigationBar : ExpanderBar
Inheritance:
object Visual UIElement FrameworkElement Control ItemsControl Selector ExpanderBar object

Remarks

For detailed documentation on this control's features and how to use them, please see the NavigationBar-related series of documentation topics.

Constructors

NavigationBar()

Initializes a new instance of the NavigationBar class.

public NavigationBar()

Properties

ArePanesVisible

Gets or sets whether the splitter and panes buttons are visible.

public bool ArePanesVisible { get; set; }

Property Value

bool:

true if the splitter and panes are visible; otherwise, false. The default value is true.

Remarks

When false, no splitter or panes will be visible. Only the header and the selected pane's content will be visible.

ContentWidth

Gets or sets the width of the navigation bar's content.

public double ContentWidth { get; set; }

Property Value

double:

The width of the navigation bar's content. The default value is NaN.

HeaderFontSize

Gets or sets the font size of the header.

public double HeaderFontSize { get; set; }

Property Value

double:

The font size of the header. The default value is NaN.

IsCustomizationEnabled

Gets or sets whether customization capabilities are enabled for the navigation bar.

public bool IsCustomizationEnabled { get; set; }

Property Value

bool:

true if customization capabilities are enabled for the navigation bar; otherwise, false. The default value is true.

IsHeaderContentVisible

Gets or sets whether the content displayed in the header is visible, normally the selected pane's title.

public bool IsHeaderContentVisible { get; set; }

Property Value

bool:

true if the content displayed in the header is visible; otherwise, false. The default value is true.

IsHeaderVisible

Gets or sets whether the header is visible, normally the selected pane's title.

public bool IsHeaderVisible { get; set; }

Property Value

bool:

true if the header is visible; otherwise, false. The default value is true.

IsMinimizable

Gets or sets whether the navigation bar can be minimized.

public bool IsMinimizable { get; set; }

Property Value

bool:

true if the navigation bar can be minimized; otherwise, false. The default value is true.

IsMinimized

Gets or sets whether the navigation bar is currently minimized.

public bool IsMinimized { get; set; }

Property Value

bool:

true if the navigation bar is currently minimized; otherwise, false. The default value is false.

IsPopupEnabled

Gets or sets whether the navigation bar's minimized popup is currently enabled.

public bool IsPopupEnabled { get; set; }

Property Value

bool:

true if the navigation bar's minimized popup is currently enabled; otherwise, false.

Remarks

This property only has an effect when IsMinimized is true.

IsPopupOpen

Gets or sets whether the navigation bar's minimized popup is currently displayed.

public bool IsPopupOpen { get; set; }

Property Value

bool:

true if the navigation bar's minimized popup is currently displayed; otherwise, false.

Remarks

This property only has an effect when IsMinimized is true.

MaxLargePaneCount

Gets or sets the maximum number of large pane buttons that should be displayed when space is available.

public int MaxLargePaneCount { get; set; }

Property Value

int:

The maximum number of large pane buttons that should be displayed when space is available. The default value is 5.

MaxPopupHeight

Gets the maximum height of the navigation bar's minimized popup.

public double MaxPopupHeight { get; }

Property Value

double:

The maximum height of the navigation bar's minimized popup.

MinimizedTitle

Gets or sets the title of the navigation bar when the navigation bar is minimized.

[Localizability(LocalizationCategory.Title)]
public string MinimizedTitle { get; set; }

Property Value

string:

The title of the navigation bar when the navigation bar is minimized.

MinimizesLeft

Gets or sets whether the navigation bar minimizes to the left.

public bool MinimizesLeft { get; set; }

Property Value

bool:

true if the navigation bar minimizes to the left; otherwise, false. The default value is true.

Remarks

Set this property to false when docking the navigation bar on the right side of its container.

PopupResizeMode

Gets or sets a ControlResizeMode that indicates the type of resizing that the popup performs.

public ControlResizeMode PopupResizeMode { get; set; }

Property Value

ControlResizeMode:

A ControlResizeMode that indicates the type of resizing that the popup performs. The default value is ControlResizeMode.Both.

SelectedPane

Gets the NavigationPane that is currently selected.

public NavigationPane SelectedPane { get; }

Property Value

NavigationPane:

The NavigationPane that is currently selected.

Title

Gets or sets the title of the navigation bar as displayed the menu item to access the Options window, and in the Options window title bar.

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

Property Value

string:

The title of the navigation bar as displayed the menu item to access the Options window, and in the Options window title bar.

Methods

ArrangeOverride(Size)

When overridden in a derived class, positions child elements and determines a size for a FrameworkElement derived class.

protected override Size ArrangeOverride(Size arrangeBounds)
Parameter Type Description
arrangeBounds Size

The final area within the parent that this element should use to arrange itself and its children.

Returns

Size:

The actual size used.

GetContainerForItemOverride()

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

protected override DependencyObject GetContainerForItemOverride()

Returns

DependencyObject:

A NavigationPane.

GetOptionsWindow()

Returns the default Options window that is used for the navigation bar.

protected virtual Window GetOptionsWindow()

Returns

Window:

The default Options window that is used for the navigation bar.

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.

MeasureOverride(Size)

When overridden in a derived class, measures the size in layout required for child elements and determines a size for the FrameworkElement-derived class.

protected override Size MeasureOverride(Size availableSize)
Parameter Type Description
availableSize Size

The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available.

Returns

Size:

The size that this element determines it needs during layout, based on its calculations of child element sizes.

OnApplyTemplate()

Invoked whenever application code or internal processes call ApplyTemplate().

public override void OnApplyTemplate()

OnCustomizeButtonClick(ContextMenuItemRoutedEventArgs)

Raises the CustomizeButtonClick event.

protected virtual void OnCustomizeButtonClick(ContextMenuItemRoutedEventArgs e)
Parameter Type Description
e ContextMenuItemRoutedEventArgs

An ItemRoutedEventArgs<ContextMenu> that contains the event data.

OnExpanded(RoutedEventArgs)

Raises the Expanded event.

protected virtual void OnExpanded(RoutedEventArgs e)
Parameter Type Description
e RoutedEventArgs

A RoutedEventArgs that contains the event data.

OnMinimized(RoutedEventArgs)

Raises the Minimized event.

protected virtual void OnMinimized(RoutedEventArgs e)
Parameter Type Description
e RoutedEventArgs

A RoutedEventArgs that contains the event data.

OnPopupClosed(RoutedEventArgs)

Raises the PopupClosed event.

protected virtual void OnPopupClosed(RoutedEventArgs e)
Parameter Type Description
e RoutedEventArgs

A RoutedEventArgs that contains the event data.

OnPopupOpened(RoutedEventArgs)

Raises the PopupOpened event.

protected virtual void OnPopupOpened(RoutedEventArgs e)
Parameter Type Description
e RoutedEventArgs

A RoutedEventArgs that contains the event data.

OnPreviewMouseDown(MouseButtonEventArgs)

Invoked when an unhandled Mouse.PreviewMouseDownEvent attached event is raised on this element. Implement this method to add class handling for this event.

protected override void OnPreviewMouseDown(MouseButtonEventArgs e)
Parameter Type Description
e MouseButtonEventArgs

A MouseButtonEventArgs that contains the event data.

OnPropertyChanged(DependencyPropertyChangedEventArgs)

Occurs when a property is changed.

protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameter Type Description
e DependencyPropertyChangedEventArgs

A System.Windows.DependencyPropertyChangedEventArgs that contains the event data.

OnSelectionChanged(SelectionChangedEventArgs)

Responds to a selection change by raising a SelectionChanged event.

protected override void OnSelectionChanged(SelectionChangedEventArgs e)
Parameter Type Description
e SelectionChangedEventArgs

A SelectionChangedEventArgs that contains the event data.

ShowOptionsWindow()

Shows the Options window for the navigation bar.

public virtual void ShowOptionsWindow()

Events

CustomizeButtonClick

Occurs when the customize button is clicked, allowing for customization of the ContextMenu it will display.

public event EventHandler<ContextMenuItemRoutedEventArgs> CustomizeButtonClick

Event Type

EventHandler<ContextMenuItemRoutedEventArgs>

Expanded

Occurs when the IsMinimized property changes to false.

public event RoutedEventHandler Expanded

Event Type

RoutedEventHandler

Minimized

Occurs when the IsMinimized property changes to true.

public event RoutedEventHandler Minimized

Event Type

RoutedEventHandler

PopupClosed

Occurs when the IsPopupOpen property changes to false.

public event RoutedEventHandler PopupClosed

Event Type

RoutedEventHandler

PopupOpened

Occurs when the IsPopupOpen property changes to true.

public event RoutedEventHandler PopupOpened

Event Type

RoutedEventHandler

Fields

ArePanesVisibleProperty

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

public static readonly DependencyProperty ArePanesVisibleProperty

ContentWidthProperty

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

public static readonly DependencyProperty ContentWidthProperty

CustomizeButtonClickEvent

Identifies the CustomizeButtonClick routed event. This field is read-only.

public static readonly RoutedEvent CustomizeButtonClickEvent

ExpandedEvent

Identifies the Expanded routed event. This field is read-only.

public static readonly RoutedEvent ExpandedEvent

HeaderFontSizeProperty

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

public static readonly DependencyProperty HeaderFontSizeProperty

IsCustomizationEnabledProperty

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

public static readonly DependencyProperty IsCustomizationEnabledProperty

IsHeaderContentVisibleProperty

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

public static readonly DependencyProperty IsHeaderContentVisibleProperty

IsHeaderVisibleProperty

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

public static readonly DependencyProperty IsHeaderVisibleProperty

IsMinimizableProperty

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

public static readonly DependencyProperty IsMinimizableProperty

IsMinimizedProperty

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

public static readonly DependencyProperty IsMinimizedProperty

IsPopupEnabledProperty

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

public static readonly DependencyProperty IsPopupEnabledProperty

IsPopupOpenProperty

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

public static readonly DependencyProperty IsPopupOpenProperty

MaxLargePaneCountProperty

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

public static readonly DependencyProperty MaxLargePaneCountProperty

MaxPopupHeightProperty

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

public static readonly DependencyProperty MaxPopupHeightProperty

MinimizedEvent

Identifies the Minimized routed event. This field is read-only.

public static readonly RoutedEvent MinimizedEvent

MinimizedTitleProperty

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

public static readonly DependencyProperty MinimizedTitleProperty

MinimizesLeftProperty

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

public static readonly DependencyProperty MinimizesLeftProperty

PopupClosedEvent

Identifies the PopupClosed routed event. This field is read-only.

public static readonly RoutedEvent PopupClosedEvent

PopupOpenedEvent

Identifies the PopupOpened routed event. This field is read-only.

public static readonly RoutedEvent PopupOpenedEvent

PopupResizeModeProperty

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

public static readonly DependencyProperty PopupResizeModeProperty

SelectedPaneProperty

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

public static readonly DependencyProperty SelectedPaneProperty

TitleProperty

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

public static readonly DependencyProperty TitleProperty

Inherited Members