In This Article

TreeListBoxItem Class

Represents an item for a TreeListBox control.

[TemplatePart(Name = "PART_ExpanderButton", Type = typeof(TreeItemExpansionToggleButton))]
[TemplateVisualState(Name = "Disabled", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Normal", GroupName = "CommonStates")]
[TemplateVisualState(Name = "PointerOver", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Pressed", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Selected", GroupName = "CommonStates")]
[TemplateVisualState(Name = "SelectedPointerOver", GroupName = "CommonStates")]
[TemplateVisualState(Name = "SelectedPressed", GroupName = "CommonStates")]
[TemplateVisualState(Name = "SelectedUnfocused", GroupName = "CommonStates")]
[TemplateVisualState(Name = "Focused", GroupName = "FocusStates")]
[TemplateVisualState(Name = "Unfocused", GroupName = "FocusStates")]
[TemplateVisualState(Name = "Off", GroupName = "DropIndicatorAreaStates")]
[TemplateVisualState(Name = "Before", GroupName = "DropIndicatorAreaStates")]
[TemplateVisualState(Name = "On", GroupName = "DropIndicatorAreaStates")]
[TemplateVisualState(Name = "After", GroupName = "DropIndicatorAreaStates")]
public class TreeListBoxItem : ContentControl
Inheritance:
object Visual UIElement FrameworkElement Control ContentControl object
Derived:
TreeListViewItem

Constructors

TreeListBoxItem()

Initializes an instance of the class.

public TreeListBoxItem()

Properties

DefaultActionCommand

The ICommand to execute when this node is double-tapped or Enter is pressed while it's focused.

public ICommand? DefaultActionCommand { get; set; }

Property Value

ICommand

DropIndicatorArea

A TreeItemDropArea that specifies the drop indicator to display.

public TreeItemDropArea DropIndicatorArea { get; }

Property Value

TreeItemDropArea

IndentAmount

The amount that this item's content is indented.

public double IndentAmount { get; set; }

Property Value

double

InnerBorderThickness

The Thickness of the inner border.

public Thickness InnerBorderThickness { get; set; }

Property Value

Thickness:

The default value is 1.

IsExpandable

Indicates whether the node is capable of being expanded or collapsed.

public bool IsExpandable { get; set; }

Property Value

bool:

true if the node is capable of being expanded or collapsed; otherwise, false.

IsExpanded

Indicates whether the node is expanded.

public bool IsExpanded { get; set; }

Property Value

bool:

true if the node is expanded; otherwise, false.

IsSelectable

Indicates whether the node is capable of being selected.

public bool IsSelectable { get; set; }

Property Value

bool:

true if the node is capable of being selected; otherwise, false.

IsSelected

Indicates whether the node is selected.

public bool IsSelected { get; set; }

Property Value

bool:

true if the node is selected; otherwise, false.

ToggleExpansionButtonStyle

The Style to use for the toggle expansion button.

public Style? ToggleExpansionButtonStyle { get; set; }

Property Value

Style

TreeLineBrush

The Brush to use to render the tree lines.

public Brush? TreeLineBrush { get; set; }

Property Value

Brush

Methods

IsLocationOverBackground(Point)

Indicates whether the specified location is past the end of the content, in owner control background whitespace area.

protected virtual bool IsLocationOverBackground(Point location)
Parameter Type Description
location Point

The location to examine.

Returns

bool:

true if the specified location is past the end of the content, in owner control background whitespace area; otherwise, false.

OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().

public override void OnApplyTemplate()

OnContextMenuOpening(ContextMenuEventArgs)

Invoked whenever an unhandled ContextMenuOpening routed event reaches this class in its route. Implement this method to add class handling for this event.

protected override void OnContextMenuOpening(ContextMenuEventArgs e)
Parameter Type Description
e ContextMenuEventArgs

The RoutedEventArgs that contains the event data.

OnCreateAutomationPeer()

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

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

The type-specific AutomationPeer implementation.

OnDoubleTapped(InputPointerButtonEventArgs)

Occurs when the item is double-tapped.

protected virtual void OnDoubleTapped(InputPointerButtonEventArgs e)
Parameter Type Description
e InputPointerButtonEventArgs

The event data.

OnDragEnter(DragEventArgs)

Invoked when an unhandled System.Windows.DragDrop.DragEnter 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 OnDragEnter(DragEventArgs e)
Parameter Type Description
e DragEventArgs

The DragEventArgs that contains the event data.

OnDragLeave(DragEventArgs)

Invoked when an unhandled System.Windows.DragDrop.DragLeave 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 OnDragLeave(DragEventArgs e)
Parameter Type Description
e DragEventArgs

The DragEventArgs that contains the event data.

OnDragOver(DragEventArgs)

Invoked when an unhandled System.Windows.DragDrop.DragOver 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 OnDragOver(DragEventArgs e)
Parameter Type Description
e DragEventArgs

The DragEventArgs that contains the event data.

OnDrop(DragEventArgs)

Invoked when an unhandled System.Windows.DragDrop.DragEnter 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 OnDrop(DragEventArgs e)
Parameter Type Description
e DragEventArgs

The DragEventArgs that contains the event data.

OnGotFocus(RoutedEventArgs)

Invoked whenever an unhandled GotFocus event reaches this element in its route.

protected override void OnGotFocus(RoutedEventArgs e)
Parameter Type Description
e RoutedEventArgs

The RoutedEventArgs that contains the event data.

OnIndentAmountChanged()

Occurs when the IndentAmount property is changed.

protected virtual void OnIndentAmountChanged()

OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)

Invoked just before the IsKeyboardFocusWithinChanged event is raised by this element. Implement this method to add class handling for this event.

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

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

OnKeyDown(KeyEventArgs)

Invoked when an unhandled System.Windows.Input.Keyboard.KeyDown 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

The KeyEventArgs that contains the event data.

OnLostFocus(RoutedEventArgs)

Raises the LostFocus routed event by using the event data that is provided.

protected override void OnLostFocus(RoutedEventArgs e)
Parameter Type Description
e RoutedEventArgs

A RoutedEventArgs that contains event data. This event data must contain the identifier for the LostFocus event.

OnTextInput(TextCompositionEventArgs)

Invoked when an unhandled System.Windows.Input.TextCompositionManager.TextInput 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 OnTextInput(TextCompositionEventArgs e)
Parameter Type Description
e TextCompositionEventArgs

The TextCompositionEventArgs that contains the event data.

ToString()

Returns the string representation of this object.

public override string ToString()

Returns

string:

The string representation of this object.

Fields

DefaultActionCommandProperty

Defines the DefaultActionCommand property.

public static readonly DependencyProperty DefaultActionCommandProperty

DropIndicatorAreaProperty

Defines the DropIndicatorArea property.

public static readonly DependencyProperty DropIndicatorAreaProperty

IndentAmountProperty

Defines the IndentAmount property.

public static readonly DependencyProperty IndentAmountProperty

InnerBorderThicknessProperty

Defines the InnerBorderThickness property.

public static readonly DependencyProperty InnerBorderThicknessProperty

IsExpandableProperty

Defines the IsExpandable property.

public static readonly DependencyProperty IsExpandableProperty

IsExpandedProperty

Defines the IsExpanded property.

public static readonly DependencyProperty IsExpandedProperty

IsSelectableProperty

Defines the IsSelectable property.

public static readonly DependencyProperty IsSelectableProperty

IsSelectedProperty

Defines the IsSelected property.

public static readonly DependencyProperty IsSelectedProperty

ToggleExpansionButtonStyleProperty

Defines the ToggleExpansionButtonStyle property.

public static readonly DependencyProperty ToggleExpansionButtonStyleProperty

TreeLineBrushProperty

Defines the TreeLineBrush property.

public static readonly DependencyProperty TreeLineBrushProperty

Extension Methods