In This Article

BreadcrumbItem Class

Represents an item in a Breadcrumb control.

[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(BreadcrumbItem))]
[StyleTypedProperty(Property = "MenuItemContainerExpandedStyle", StyleTargetType = typeof(MenuItem))]
[StyleTypedProperty(Property = "MenuItemContainerStyle", StyleTargetType = typeof(MenuItem))]
public class BreadcrumbItem : HeaderedItemsControl, IBreadcrumbCommon
Inheritance:
object Visual UIElement FrameworkElement Control ItemsControl HeaderedItemsControl object
Implements:
IBreadcrumbCommon

Constructors

BreadcrumbItem()

Initializes an instance of the class.

public BreadcrumbItem()

Properties

ConstrainedWidth

The constrained width of the BreadcrumbItem.

public double ConstrainedWidth { get; }

Property Value

double

ContainsSelection

Indicates whether the BreadcrumbItem contains the item selected in the associated Breadcrumb control.

public bool ContainsSelection { get; }

Property Value

bool

ExpandedContainer

The BreadcrumbItem container for the ExpandedItem.

public BreadcrumbItem? ExpandedContainer { get; }

Property Value

BreadcrumbItem

ExpandedItem

The next expanded item in the Breadcrumb.

public object? ExpandedItem { get; }

Property Value

object

ImageSource

The image that appears in the Breadcrumb when the BreadcrumbItem is selected.

public ImageSource? ImageSource { get; set; }

Property Value

ImageSource

IsMinimized

Indicates whether the BreadcrumbItem is minimized.

public bool IsMinimized { get; }

Property Value

bool

IsOverflowed

Indicates whether the header for the BreadcrumbItem has been moved to an overflow drop-down because of limited space in the associated Breadcrumb control.

public bool IsOverflowed { get; }

Property Value

bool

IsSelected

Indicates whether a BreadcrumbItem control is selected.

public bool IsSelected { get; set; }

Property Value

bool

Remarks

When the IsSelected property value changes to true, the Selected event occurs. When the IsSelected property value changes to false, the Unselected event occurs.

IsTailItem

Indicates whether the BreadcrumbItem is a tail item.

public bool IsTailItem { get; }

Property Value

bool

IsWidthConstrained

Indicates whether the width of the BreadcrumbItem is constrained.

public bool IsWidthConstrained { get; }

Property Value

bool

ItemMinimizedTemplate

The DataTemplate used to display each minimized item in the trail.

public DataTemplate? ItemMinimizedTemplate { get; set; }

Property Value

DataTemplate

ItemMinimizedTemplateSelector

The custom logic for choosing a template used to display each minimized item in the trail.

public DataTemplateSelector? ItemMinimizedTemplateSelector { get; set; }

Property Value

DataTemplateSelector

LogicalChildren

Gets an enumerator to the logical child elements of the HeaderedItemsControl.

protected override IEnumerator? LogicalChildren { get; }

Property Value

IEnumerator:

An enumerator. The default is null.

MenuHorizontalOffset

The horizontal distance between the target origin and the content menu alignment point.

public double MenuHorizontalOffset { get; set; }

Property Value

double

MenuItemContainerExpandedStyle

The Style that is applied to the MenuItem elements generated for expanded items in context menus.

public Style? MenuItemContainerExpandedStyle { get; set; }

Property Value

Style

MenuItemContainerExpandedStyleSelector

Custom logic for choosing a Style that can be applied to MenuItem elements generated for expanded items in context menus.

public StyleSelector? MenuItemContainerExpandedStyleSelector { get; set; }

Property Value

StyleSelector

MenuItemContainerStyle

The Style that is applied to the MenuItem elements generated for items in context menus.

public Style? MenuItemContainerStyle { get; set; }

Property Value

Style

MenuItemContainerStyleSelector

Custom logic for choosing a Style that can be applied to MenuItem elements generated for items in context menus.

public StyleSelector? MenuItemContainerStyleSelector { get; set; }

Property Value

StyleSelector

MenuItemExpandedTemplate

The DataTemplate used to display expanded items in a MenuItem.

public DataTemplate? MenuItemExpandedTemplate { get; set; }

Property Value

DataTemplate

MenuItemExpandedTemplateSelector

The custom logic for choosing a template used to display expanded items in a MenuItem.

public DataTemplateSelector? MenuItemExpandedTemplateSelector { get; set; }

Property Value

DataTemplateSelector

MenuItemTemplate

The DataTemplate used to display each item in a MenuItem.

public DataTemplate? MenuItemTemplate { get; set; }

Property Value

DataTemplate

MenuItemTemplateSelector

The custom logic for choosing a template used to display each item in a MenuItem.

public DataTemplateSelector? MenuItemTemplateSelector { get; set; }

Property Value

DataTemplateSelector

MenuVerticalOffset

The vertical distance between the target origin and the content menu alignment point.

public double MenuVerticalOffset { get; set; }

Property Value

double

PathEntry

The path entry of this item.

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

Property Value

string

TailIndex

The position of the BreadcrumbItem below the selected item. If the BreadcrumbItem is the selected item or contains the selected item, then the index will be -1.

public int TailIndex { get; }

Property Value

int

Methods

GetLastContainer()

Gets the last BreadcrumbItem, which may be this BreadcrumbItem.

public BreadcrumbItem GetLastContainer()

Returns

BreadcrumbItem

GetLastItem()

Gets the last data item, which may be associated with this BreadcrumbItem.

public object? GetLastItem()

Returns

object

MeasureOverride(Size)

Called to remeasure a control.

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

The maximum size that the method can return.

Returns

Size:

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

OnCreateAutomationPeer()

Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

protected override AutomationPeer? OnCreateAutomationPeer()

Returns

AutomationPeer:

The type-specific AutomationPeer implementation.

OnItemsChanged(NotifyCollectionChangedEventArgs)

Invoked when the Items property changes.

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

Information about the change.

OnNavigateButtonClick(ContextMenuItemRoutedEventArgs)

Raises the NavigateButtonClick event.

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

The event data.

OnSelectItem(ExecutedRoutedEventArgs)

Invoked when the SelectItem command is executed.

protected virtual void OnSelectItem(ExecutedRoutedEventArgs e)
Parameter Type Description
e ExecutedRoutedEventArgs

The ExecutedRoutedEventArgs instance containing the event data.

Remarks

When the command parameter is null, then this BreadcrumbItem should be selected; otherwise the specified item should be selected.

OnSelected()

Raises the Selected event.

protected virtual void OnSelected()

OnUnselected()

Raises the Unselected event.

protected virtual void OnUnselected()

OnVisualParentChanged(DependencyObject)

Invoked when the parent of this element in the visual tree is changed. Overrides System.Windows.UIElement.OnVisualParentChanged(System.Windows.DependencyObject).

protected override void OnVisualParentChanged(DependencyObject oldParent)
Parameter Type Description
oldParent DependencyObject

The old parent element. May be null to indicate that the element did not have a visual parent previously.

Events

NavigateButtonClick

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

public event EventHandler<ContextMenuItemRoutedEventArgs> NavigateButtonClick

Event Type

EventHandler<ContextMenuItemRoutedEventArgs>

Selected

Occurs when the IsSelected property changes from false to true.

public event RoutedEventHandler Selected

Event Type

RoutedEventHandler

Remarks

The event occurs when a BreadcrumbItem becomes the selected BreadcrumbItem in a Breadcrumb control. This event is related to the SelectedItemChanged event that occurs when there is a change in the SelectedItem property of a Breadcrumb control.

Unselected

Occurs when the IsSelected property changes from true to false.

public event RoutedEventHandler Unselected

Event Type

RoutedEventHandler

Remarks

The event occurs when the selection changes from this BreadcrumbItem to another BreadcrumbItem in a Breadcrumb control. This event is related to the SelectedItemChanged event that occurs when there is a change in the SelectedItem property of a Breadcrumb control.

Fields

ConstrainedWidthProperty

Defines the ConstrainedWidth property.

public static readonly DependencyProperty ConstrainedWidthProperty

ContainsSelectionProperty

Defines the ContainsSelection property.

public static readonly DependencyProperty ContainsSelectionProperty

ExpandedContainerProperty

Defines the ExpandedContainer property.

public static readonly DependencyProperty ExpandedContainerProperty

ExpandedItemProperty

Defines the ExpandedItem property.

public static readonly DependencyProperty ExpandedItemProperty

ImageSourceProperty

Defines the ImageSource property.

public static readonly DependencyProperty ImageSourceProperty

IsMinimizedProperty

Defines the IsMinimized property.

public static readonly DependencyProperty IsMinimizedProperty

IsOverflowedProperty

Defines the IsOverflowed property.

public static readonly DependencyProperty IsOverflowedProperty

IsSelectedProperty

Defines the IsSelected property.

public static readonly DependencyProperty IsSelectedProperty

IsTailItemProperty

Defines the IsTailItem property.

public static readonly DependencyProperty IsTailItemProperty

IsWidthConstrainedProperty

Defines the IsWidthConstrained property.

public static readonly DependencyProperty IsWidthConstrainedProperty

ItemMinimizedTemplateProperty

Defines the ItemMinimizedTemplate property.

public static readonly DependencyProperty ItemMinimizedTemplateProperty

ItemMinimizedTemplateSelectorProperty

Defines the ItemMinimizedTemplateSelector property.

public static readonly DependencyProperty ItemMinimizedTemplateSelectorProperty

MenuHorizontalOffsetProperty

Defines the MenuHorizontalOffset property.

public static readonly DependencyProperty MenuHorizontalOffsetProperty

MenuItemContainerExpandedStyleProperty

Defines the MenuItemContainerExpandedStyle property.

public static readonly DependencyProperty MenuItemContainerExpandedStyleProperty

MenuItemContainerExpandedStyleSelectorProperty

public static readonly DependencyProperty MenuItemContainerExpandedStyleSelectorProperty

MenuItemContainerStyleProperty

Defines the MenuItemContainerStyle property.

public static readonly DependencyProperty MenuItemContainerStyleProperty

MenuItemContainerStyleSelectorProperty

Defines the MenuItemContainerStyleSelector property.

public static readonly DependencyProperty MenuItemContainerStyleSelectorProperty

MenuItemExpandedTemplateProperty

Defines the MenuItemExpandedTemplate property.

public static readonly DependencyProperty MenuItemExpandedTemplateProperty

MenuItemExpandedTemplateSelectorProperty

Defines the MenuItemExpandedTemplateSelector property.

public static readonly DependencyProperty MenuItemExpandedTemplateSelectorProperty

MenuItemTemplateProperty

Defines the MenuItemTemplate property.

public static readonly DependencyProperty MenuItemTemplateProperty

MenuItemTemplateSelectorProperty

Defines the MenuItemTemplateSelector property.

public static readonly DependencyProperty MenuItemTemplateSelectorProperty

MenuVerticalOffsetProperty

Defines the MenuVerticalOffset property.

public static readonly DependencyProperty MenuVerticalOffsetProperty

NavigateButtonClickEvent

Defines the NavigateButtonClick routed event.

public static readonly RoutedEvent NavigateButtonClickEvent

PathEntryProperty

Defines the PathEntry property.

public static readonly DependencyProperty PathEntryProperty

SelectedEvent

Defines the Selected routed event.

public static readonly RoutedEvent SelectedEvent

TailIndexProperty

Defines the TailIndex property.

public static readonly DependencyProperty TailIndexProperty

UnselectedEvent

Defines the Unselected routed event.

public static readonly RoutedEvent UnselectedEvent

Extension Methods