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.
ContainsSelection
Indicates whether the BreadcrumbItem contains the item selected in the associated Breadcrumb control.
ExpandedContainer
The BreadcrumbItem container for the ExpandedItem.
ExpandedItem
The next expanded item in the Breadcrumb.
ImageSource
The image that appears in the Breadcrumb when the BreadcrumbItem is selected.
IsMinimized
Indicates whether the BreadcrumbItem is minimized.
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.
IsSelected
Indicates whether a BreadcrumbItem control is selected.
public bool IsSelected { get; set; }
Property Value
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.
IsWidthConstrained
Indicates whether the width of the BreadcrumbItem is constrained.
ItemMinimizedTemplate
The DataTemplate used to display each minimized item in the trail.
ItemMinimizedTemplateSelector
The custom logic for choosing a template used to display each minimized item in the trail.
public DataTemplateSelector? ItemMinimizedTemplateSelector { get; set; }
Property Value
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.
MenuItemContainerExpandedStyle
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
MenuItemContainerStyle
MenuItemContainerStyleSelector
Custom logic for choosing a Style that can be applied to MenuItem elements generated for items in context menus.
MenuItemExpandedTemplate
The DataTemplate used to display expanded items in a MenuItem.
MenuItemExpandedTemplateSelector
The custom logic for choosing a template used to display expanded items in a MenuItem.
public DataTemplateSelector? MenuItemExpandedTemplateSelector { get; set; }
Property Value
MenuItemTemplate
The DataTemplate used to display each item in a MenuItem.
MenuItemTemplateSelector
The custom logic for choosing a template used to display each item in a MenuItem.
public DataTemplateSelector? MenuItemTemplateSelector { get; set; }
Property Value
MenuVerticalOffset
The vertical distance between the target origin and the content menu alignment point.
PathEntry
The path entry of this item.
[Localizability(LocalizationCategory.Title)]
public string? PathEntry { get; set; }
Property Value
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.
Methods
GetLastContainer()
Gets the last BreadcrumbItem, which may be this BreadcrumbItem.
GetLastItem()
Gets the last data item, which may be associated with this BreadcrumbItem.
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 |
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
Selected
Occurs when the IsSelected property changes from false to true.
public event RoutedEventHandler Selected
Event Type
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
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
Defines the MenuItemContainerExpandedStyleSelector property.
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