Gets or sets an input source for the bitmap effect that applies directly to the rendered content for this element. Gets or sets the BindingGroup that is used for the element. Gets or sets a brush that describes the background of a control. Gets a value that indicates whether at least one touch is pressed over this element or any child elements in its visual tree. Gets a value that indicates whether at least one touch is pressed over this element. Gets a value that indicates whether at least one touch is captured to this element or to any child elements in its visual tree. Gets a value that indicates whether at least one touch is captured to this element. Gets or sets the number of alternating item containers in the ItemsControl, which enables alternating containers to have a unique appearance. Gets or sets a value indicating whether this element can be used as the target of a drag-and-drop operation. Gets the rendered height of this element. Identified by the Unselected routed event. Identifies the IsSelectionActive dependency property. Identifies the IsSelected dependency property. Identifies the IsExpanded dependency property. Initializes a new instance of the TreeViewItem class. You can find a list of visual properties in the Changing the Visual Structure of a Control section in the Customizing the Appearance of an Existing Control by Creating a ControlTemplate article. Setting a visual property only has an effect if that property is both present in the control's default template and is set by using a TemplateBinding. The default style is determined by which desktop theme is used when the application is running.
If a property is set by a default style, the property might change from its default value when the control appears in the application. To see the parts and states that are specific to the TreeViewItem, see TreeView Styles and Templates.ĭependency properties for this control might be set by the control's default style. For more information about creating a ControlTemplate, see Customizing the Appearance of an Existing Control by Creating a ControlTemplate. You can modify the default ControlTemplate to give the control a unique appearance. To apply the same property settings to multiple TreeViewItem controls, use the Style property. To expand or collapse a TreeViewItem, use the IsExpanded property.įor more information about the TreeView control, see the TreeView Overview. The following illustration shows a hierarchy of TreeViewItem controls inside a TreeView. TreeViewItem controls can be embedded inside other TreeViewItem controls to create a hierarchy of nodes inside a TreeView control. For more information, see the HeaderedItemsControl class. TreeViewItem is a HeaderedItemsControl, which means its header and collection of objects can be of any type (such as string, image, or panel). The following example shows how to create a hierarchy of TreeViewItem controls in a TreeView control. IHierarchicalVirtualizationAndScrollInfo Examples Implements IHierarchicalVirtualizationAndScrollInfo Inheritance
Inherits HeaderedItemsControl Public Class TreeViewItem Interface IHierarchicalVirtualizationAndScrollInfo Public Class TreeViewItem
Interface VirtualizingStackPanel.IProvideStackingSize Public class TreeViewItem :, .IHierarchicalVirtualizationAndScrollInfo public ref class TreeViewItem : System::Windows::Controls::HeaderedItemsControl public ref class TreeViewItem : System::Windows::Controls::HeaderedItemsControl, System::Windows::Controls::Primitives::IHierarchicalVirtualizationAndScrollInfo Implements a selectable item in a TreeView control.