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

Constructors

NavigationBar()

Initializes an instance of the class.

public NavigationBar()

Properties

ArePanesVisible

Indicates 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

The width of the navigation bar's content.

public double ContentWidth { get; set; }

Property Value

double:

The default value is NaN.

HeaderFontSize

The font size of the header.

public double HeaderFontSize { get; set; }

Property Value

double:

The default value is NaN.

IsCustomizationEnabled

Indicates 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

Indicates 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

Indicates 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

Indicates 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

Indicates 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.

IsPopupEnabled

Indicates whether the navigation bar's minimized popup is currently enabled.

public bool IsPopupEnabled { get; set; }

Property Value

bool

Remarks

This property only has an effect when IsMinimized is true.

IsPopupOpen

Indicates whether the navigation bar's minimized popup is currently displayed.

public bool IsPopupOpen { get; set; }

Property Value

bool

Remarks

This property only has an effect when IsMinimized is true.

MaxLargePaneCount

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

public int MaxLargePaneCount { get; set; }

Property Value

int:

The default value is 5.

MaxPopupHeight

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

public double MaxPopupHeight { get; }

Property Value

double

MinimizedTitle

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

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

Property Value

string

MinimizesLeft

Indicates whether the navigation bar minimizes to the left.

public bool MinimizesLeft { get; set; }

Property Value

bool

Remarks

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

PopupResizeMode

The ControlResizeMode that indicates the type of resizing that the popup performs.

public ControlResizeMode PopupResizeMode { get; set; }

Property Value

ControlResizeMode:

The default value is Both.

SelectedPane

The currently selected NavigationPane.

public NavigationPane? SelectedPane { get; }

Property Value

NavigationPane

Title

The title of the navigation bar as displayed in 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

Methods

ArrangeOverride(Size)

Called to arrange and size the content of a Control object.

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

The computed size that is used to arrange the content.

Returns

Size:

The size of the control.

GetContainerForItemOverride()

Creates or identifies the element that is used to display the given item.

protected override DependencyObject GetContainerForItemOverride()

Returns

DependencyObject:

The element that is used to display the given item.

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 container.

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

The item to check.

Returns

bool:

true if the item is (or is eligible to be) its own container; otherwise, false.

MeasureOverride(Size)

Called to remeasure a control.

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

Returns

Size:

The size of the control, up to the maximum specified by constraint.

OnApplyTemplate()

When overridden in a derived class, is 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

The event data.

OnExpanded(RoutedEventArgs)

Raises the Expanded event.

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

The event data.

OnMinimized(RoutedEventArgs)

Raises the Minimized event.

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

The event data.

OnPopupClosed(RoutedEventArgs)

Raises the PopupClosed event.

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

The event data.

OnPopupOpened(RoutedEventArgs)

Raises the PopupOpened event.

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

The event data.

OnPreviewMouseDown(MouseButtonEventArgs)

Invoked when an unhandled System.Windows.Input.Mouse.PreviewMouseDown attached routed 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 OnPreviewMouseDown(MouseButtonEventArgs e)
Parameter Type Description
e MouseButtonEventArgs

The MouseButtonEventArgs that contains the event data. The event data reports that one or more mouse buttons were pressed.

OnPropertyChanged(DependencyPropertyChangedEventArgs)

Invoked whenever the effective value of any dependency property on this FrameworkElement has been updated. The specific dependency property that changed is reported in the arguments parameter. Overrides System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs).

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

The event data that describes the property that changed, as well as old and new values.

OnSelectionChanged(SelectionChangedEventArgs)

Called when the selection changes.

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

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

Defines the ArePanesVisible property.

public static readonly DependencyProperty ArePanesVisibleProperty

ContentWidthProperty

Defines the ContentWidth property.

public static readonly DependencyProperty ContentWidthProperty

CustomizeButtonClickEvent

Defines the CustomizeButtonClick routed event.

public static readonly RoutedEvent CustomizeButtonClickEvent

ExpandedEvent

Defines the Expanded routed event.

public static readonly RoutedEvent ExpandedEvent

HeaderFontSizeProperty

Defines the HeaderFontSize property.

public static readonly DependencyProperty HeaderFontSizeProperty

IsCustomizationEnabledProperty

Defines the IsCustomizationEnabled property.

public static readonly DependencyProperty IsCustomizationEnabledProperty

IsHeaderContentVisibleProperty

Defines the IsHeaderContentVisible property.

public static readonly DependencyProperty IsHeaderContentVisibleProperty

IsHeaderVisibleProperty

Defines the IsHeaderVisible property.

public static readonly DependencyProperty IsHeaderVisibleProperty

IsMinimizableProperty

Defines the IsMinimizable property.

public static readonly DependencyProperty IsMinimizableProperty

IsMinimizedProperty

Defines the IsMinimized property.

public static readonly DependencyProperty IsMinimizedProperty

IsPopupEnabledProperty

Defines the IsPopupEnabled property.

public static readonly DependencyProperty IsPopupEnabledProperty

IsPopupOpenProperty

Defines the IsPopupOpen property.

public static readonly DependencyProperty IsPopupOpenProperty

MaxLargePaneCountProperty

Defines the MaxLargePaneCount property.

public static readonly DependencyProperty MaxLargePaneCountProperty

MaxPopupHeightProperty

Defines the MaxPopupHeight property.

public static readonly DependencyProperty MaxPopupHeightProperty

MinimizedEvent

Defines the Minimized routed event.

public static readonly RoutedEvent MinimizedEvent

MinimizedTitleProperty

Defines the MinimizedTitle property.

public static readonly DependencyProperty MinimizedTitleProperty

MinimizesLeftProperty

Defines the MinimizesLeft property.

public static readonly DependencyProperty MinimizesLeftProperty

PopupClosedEvent

Defines the PopupClosed routed event.

public static readonly RoutedEvent PopupClosedEvent

PopupOpenedEvent

Defines the PopupOpened routed event.

public static readonly RoutedEvent PopupOpenedEvent

PopupResizeModeProperty

Defines the PopupResizeMode property.

public static readonly DependencyProperty PopupResizeModeProperty

SelectedPaneProperty

Defines the SelectedPane property.

public static readonly DependencyProperty SelectedPaneProperty

TitleProperty

Defines the Title property.

public static readonly DependencyProperty TitleProperty

Inherited Members

Extension Methods