TreeListView Class
Represents an advanced multi-column tree view control.
public class TreeListView : TreeListBox
- Inheritance:
- object Visual UIElement FrameworkElement Control ItemsControl TreeListBox object
- Derived:
- PropertyGrid ShellListView
Constructors
TreeListView()
Initializes an instance of the TreeListView class.
public TreeListView()
Properties
AreColumnHeadersVisible
Gets or sets whether column headers are visible.
public bool AreColumnHeadersVisible { get; set; }
Property Value
- bool:
true
if column headers are visible; otherwise,false
. The default value istrue
.
CanColumnsReorder
Gets or sets whether columns can be reordered by the end user.
public bool CanColumnsReorder { get; set; }
Property Value
- bool:
true
if columns can be reordered by the end user; otherwise,false
. The default value isfalse
.
CanColumnsResize
Gets or sets whether columns can be resized by the end user.
public bool CanColumnsResize { get; set; }
Property Value
- bool:
true
if columns can be resized by the end user; otherwise,false
. The default value istrue
.
CanColumnsToggleVisibility
Gets or sets whether columns can have their visibility toggled by the end user.
public bool CanColumnsToggleVisibility { get; set; }
Property Value
- bool:
true
if columns can have their visibility toggled by the end user; otherwise,false
. The default value isfalse
.
ColumnHeaderHeight
Gets the height of the column header.
Columns
Gets the collection of columns in the control.
public ObservableCollection<TreeListViewColumn> Columns { get; }
Property Value
- ObservableCollection<TreeListViewColumn>:
The collection of columns in the control.
ExpansionColumnIndex
Gets or sets the index of the columns that contains the indentation and expander button.
public int ExpansionColumnIndex { get; set; }
Property Value
- int:
The index of the columns that contains the indentation and expander button. The default value is
0
.
FrozenColumnCount
Gets or sets the number of non-scrolling columns, that are always displayed left-most and cannot be scrolled out of visibility.
public int FrozenColumnCount { get; set; }
Property Value
- int:
The number of non-scrolling columns. The default value is
0
.
IsDefaultColumnHeaderContextMenuEnabled
Gets or sets whether the default column header context menu is enabled.
public bool IsDefaultColumnHeaderContextMenuEnabled { get; set; }
Property Value
- bool:
true
if the default column header context menu is enabled; otherwise,false
. The default value istrue
.
IsKeyboardFocusWithinContent
Gets whether keyboard focus is within the content area, and not in any header area.
protected override bool IsKeyboardFocusWithinContent { get; }
Property Value
- bool:
true
if keyboard focus is within the content area; otherwise,false
.
SizeAllColumnsToFitCommand
Gets the ICommand that sizes all non-star width columns to fit.
public ICommand SizeAllColumnsToFitCommand { get; }
Property Value
Methods
ArrangeOverride(Size)
When overridden in a derived class, positions child elements and determines a size for a FrameworkElement derived class.
protected override Size ArrangeOverride(Size finalSize)
Parameter | Type | Description |
---|---|---|
finalSize | Size | The final area within the parent that this element should use to arrange itself and its children. |
Returns
- Size:
The actual size used.
ClearContainerForItemOverride(DependencyObject, object)
Removes the effects of a PrepareContainerForItemOverride(DependencyObject, object) call.
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameter | Type | Description |
---|---|---|
element | DependencyObject | The System.Windows.DependencyObject that is the wrapper element. |
item | object | The item that is being wrapped. |
GetColumnHeaderVisibility(ScrollViewer)
Gets the value of the ColumnHeaderVisibility
attached property for the specified object.
public static Visibility GetColumnHeaderVisibility(ScrollViewer obj)
Parameter | Type | Description |
---|---|---|
obj | ScrollViewer | The object from which the property value is read. |
Returns
- Visibility:
The object's value.
GetContainerForItemOverride()
Creates or identifies the element used to display the specified item.
protected override DependencyObject GetContainerForItemOverride()
Returns
- DependencyObject:
The element that is used to display the given item.
GetFrozenColumnsWidth(ScrollViewer)
Gets the value of the FrozenColumnsWidth
attached property for the specified object.
public static double GetFrozenColumnsWidth(ScrollViewer obj)
Parameter | Type | Description |
---|---|---|
obj | ScrollViewer | The object from which the property value is read. |
Returns
- double:
The object's value.
IsItemItsOwnContainerOverride(object)
Determines if the specified item is (or is eligible to be) its own item container.
protected override bool IsItemItsOwnContainerOverride(object item)
Parameter | Type | Description |
---|---|---|
item | object | Specified item. |
Returns
- bool:
true
if the item is its own item container; otherwise,false
.
MeasureOverride(Size)
When overridden in a derived class, measures the size in layout required for child elements and determines a size for the FrameworkElement-derived class.
protected override Size MeasureOverride(Size availableSize)
Parameter | Type | Description |
---|---|---|
availableSize | Size | The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available. |
Returns
- Size:
The size that this element determines it needs during layout, based on its calculations of child element sizes.
OnApplyTemplate()
Invoked whenever application code or internal processes call ApplyTemplate
.
public override void OnApplyTemplate()
OnColumnHeaderMenuRequested(TreeListViewColumnMenuEventArgs)
Occurs when a column header requests a context menu.
protected virtual void OnColumnHeaderMenuRequested(TreeListViewColumnMenuEventArgs e)
Parameter | Type | Description |
---|---|---|
e | TreeListViewColumnMenuEventArgs | The |
Remarks
This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.
OnColumnHeaderTapped(TreeListViewColumnEventArgs)
Occurs when a column's header is tapped.
protected virtual void OnColumnHeaderTapped(TreeListViewColumnEventArgs e)
Parameter | Type | Description |
---|---|---|
e | TreeListViewColumnEventArgs | The |
Remarks
This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.
OnColumnIsVisibleChanged(TreeListViewColumnEventArgs)
Occurs when a column's visibility has changed.
protected virtual void OnColumnIsVisibleChanged(TreeListViewColumnEventArgs e)
Parameter | Type | Description |
---|---|---|
e | TreeListViewColumnEventArgs | The |
Remarks
This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.
OnColumnReordered(TreeListViewColumnEventArgs)
Occurs after a column is reordered by the end user.
protected virtual void OnColumnReordered(TreeListViewColumnEventArgs e)
Parameter | Type | Description |
---|---|---|
e | TreeListViewColumnEventArgs | The |
Remarks
This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.
OnColumnsResized(RoutedEventArgs)
Occurs after the ActualWidth of one or more columns changes.
protected virtual void OnColumnsResized(RoutedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | RoutedEventArgs | The |
Remarks
This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.
OnCreateAutomationPeer()
Returns an AutomationPeer object for this control instance.
protected override AutomationPeer OnCreateAutomationPeer()
Returns
- AutomationPeer:
An AutomationPeer instance.
OnScrollViewerScrollChanged(ScrollChangedEventArgs)
Occurs when the scroll viewer's scroll is changed.
protected override void OnScrollViewerScrollChanged(ScrollChangedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | ScrollChangedEventArgs | The ScrollChangedEventArgs that contains data related to the event. |
PrepareContainerForItemOverride(DependencyObject, object)
Prepares the specified element to display the specified item.
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameter | Type | Description |
---|---|---|
element | DependencyObject | The System.Windows.DependencyObject that is the wrapper element. |
item | object | The item that is being wrapped. |
SetColumnHeaderVisibility(ScrollViewer, Visibility)
Sets the value of the ColumnHeaderVisibility
attached property to the specified object.
public static void SetColumnHeaderVisibility(ScrollViewer obj, Visibility value)
Parameter | Type | Description |
---|---|---|
obj | ScrollViewer | The object to which the attached property is written. |
value | Visibility | The value to set. |
SetFrozenColumnsWidth(ScrollViewer, double)
Sets the value of the FrozenColumnsWidth
attached property to the specified object.
public static void SetFrozenColumnsWidth(ScrollViewer obj, double value)
Parameter | Type | Description |
---|---|---|
obj | ScrollViewer | The object to which the attached property is written. |
value | double | The value to set. |
SizeAllColumnsToFit()
Sizes all non-star width columns to fit.
public void SizeAllColumnsToFit()
Events
ColumnHeaderMenuRequested
Occurs when a column header requests a context menu.
public event EventHandler<TreeListViewColumnMenuEventArgs> ColumnHeaderMenuRequested
Event Type
ColumnHeaderTapped
Occurs when a column's header is tapped.
public event EventHandler<TreeListViewColumnEventArgs> ColumnHeaderTapped
Event Type
ColumnIsVisibleChanged
Occurs when a column's visibility has changed.
public event EventHandler<TreeListViewColumnEventArgs> ColumnIsVisibleChanged
Event Type
ColumnReordered
Occurs after a column is reordered by the end user.
public event EventHandler<TreeListViewColumnEventArgs> ColumnReordered
Event Type
ColumnsResized
Occurs after the ActualWidth of one or more columns changes.
Fields
AreColumnHeadersVisibleProperty
Identifies the AreColumnHeadersVisible dependency property. This field is read-only.
public static readonly DependencyProperty AreColumnHeadersVisibleProperty
CanColumnsReorderProperty
Identifies the CanColumnsReorder dependency property. This field is read-only.
public static readonly DependencyProperty CanColumnsReorderProperty
CanColumnsResizeProperty
Identifies the CanColumnsResize dependency property. This field is read-only.
public static readonly DependencyProperty CanColumnsResizeProperty
CanColumnsToggleVisibilityProperty
Identifies the CanColumnsToggleVisibility dependency property. This field is read-only.
public static readonly DependencyProperty CanColumnsToggleVisibilityProperty
ColumnHeaderHeightProperty
Identifies the ColumnHeaderHeight
dependency property. This field is read-only.
public static readonly DependencyProperty ColumnHeaderHeightProperty
ColumnHeaderMenuRequestedEvent
Identifies the ColumnHeaderMenuRequested routed event. This field is read-only.
public static readonly RoutedEvent ColumnHeaderMenuRequestedEvent
ColumnHeaderTappedEvent
Identifies the ColumnHeaderTapped routed event. This field is read-only.
public static readonly RoutedEvent ColumnHeaderTappedEvent
ColumnHeaderVisibilityProperty
Identifies the ColumnHeaderVisibility
dependency property. This field is read-only.
public static readonly DependencyProperty ColumnHeaderVisibilityProperty
ColumnIsVisibleChangedEvent
Identifies the ColumnIsVisibleChanged routed event. This field is read-only.
public static readonly RoutedEvent ColumnIsVisibleChangedEvent
ColumnReorderedEvent
Identifies the ColumnReordered routed event. This field is read-only.
public static readonly RoutedEvent ColumnReorderedEvent
ColumnsResizedEvent
Identifies the ColumnsResized routed event. This field is read-only.
public static readonly RoutedEvent ColumnsResizedEvent
ExpansionColumnIndexProperty
Identifies the ExpansionColumnIndex dependency property. This field is read-only.
public static readonly DependencyProperty ExpansionColumnIndexProperty
FrozenColumnCountProperty
Identifies the FrozenColumnCount dependency property. This field is read-only.
public static readonly DependencyProperty FrozenColumnCountProperty
FrozenColumnsWidthProperty
Identifies the FrozenColumnsWidth
dependency property. This field is read-only.
public static readonly DependencyProperty FrozenColumnsWidthProperty
IsDefaultColumnHeaderContextMenuEnabledProperty
Identifies the IsDefaultColumnHeaderContextMenuEnabled dependency property. This field is read-only.
public static readonly DependencyProperty IsDefaultColumnHeaderContextMenuEnabledProperty
Inherited Members
- TreeListBox.AutoExpandItemsOnFilterProperty
- TreeListBox.CanDragItemsProperty
- TreeListBox.DataFilterProperty
- TreeListBox.EmptyContentProperty
- TreeListBox.EmptyContentTemplateProperty
- TreeListBox.IndentIncrementProperty
- TreeListBox.IsDataVirtualizationEnabledProperty
- TreeListBox.IsEmptyProperty
- TreeListBox.IsFilterActiveProperty
- TreeListBox.IsRootItemVisibleProperty
- TreeListBox.ItemAdapterProperty
- TreeListBox.MultiDragKindProperty
- TreeListBox.PathSeparatorProperty
- TreeListBox.RootItemProperty
- TreeListBox.TopLevelIndentProperty
- TreeListBox.ItemDataFormat
- TreeListBox.FilterAppliedEvent
- TreeListBox.IsRootItemVisibleChangedEvent
- TreeListBox.ItemCollapsedEvent
- TreeListBox.ItemCollapsingEvent
- TreeListBox.ItemDefaultActionExecutingEvent
- TreeListBox.ItemExpandedEvent
- TreeListBox.ItemExpandingEvent
- TreeListBox.ItemMenuRequestedEvent
- TreeListBox.ItemSelectingEvent
- TreeListBox.RootItemChangedEvent
- TreeListBox.SelectionChangedEvent
- TreeListBox.CanSelectItemOnFocusProperty
- TreeListBox.MultiSelectionKindProperty
- TreeListBox.SelectionModeProperty
- TreeListBox.SelectedItemProperty
- TreeListBox.HasTreeLinesProperty
- TreeListBox.IsSelectionActiveProperty
- TreeListBox.BringItemIntoView(object)
- TreeListBox.BringItemIntoViewByFullPath(string)
- TreeListBox.CollapseAll()
- TreeListBox.ExpandAll()
- TreeListBox.GetFullPath(object)
- TreeListBox.GetItemByFullPath(string)
- TreeListBox.GetItemNavigator(object)
- TreeListBox.InvalidateChildren(object)
- TreeListBox.OnDragEnter(DragEventArgs)
- TreeListBox.OnDragLeave(DragEventArgs)
- TreeListBox.OnDragOver(DragEventArgs)
- TreeListBox.OnDrop(DragEventArgs)
- TreeListBox.OnKeyDown(KeyEventArgs)
- TreeListBox.ProcessKeyDown(KeyEventArgs)
- TreeListBox.OnFilterApplied(RoutedEventArgs)
- TreeListBox.OnIsRootItemVisibleChanged(RoutedEventArgs)
- TreeListBox.OnItemCollapsed(TreeListBoxItemExpansionEventArgs)
- TreeListBox.OnItemCollapsing(TreeListBoxItemExpansionEventArgs)
- TreeListBox.OnItemDefaultActionExecuting(TreeListBoxItemEventArgs)
- TreeListBox.OnItemExpanded(TreeListBoxItemExpansionEventArgs)
- TreeListBox.OnItemExpanding(TreeListBoxItemExpansionEventArgs)
- TreeListBox.OnItemMenuRequested(TreeListBoxItemMenuEventArgs)
- TreeListBox.OnItemSelecting(TreeListBoxItemEventArgs)
- TreeListBox.OnRootItemChanged(RoutedEventArgs)
- TreeListBox.OnSelectionChanged(SelectionChangedEventArgs)
- TreeListBox.FocusItem(object)
- TreeListBox.FocusItemByFullPath(string)
- TreeListBox.CreateSelectionBatch()
- TreeListBox.SelectItemByFullPath(string)
- TreeListBox.GetIsSelectionActive(TreeListBox)
- TreeListBox.OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)
- TreeListBox.OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
- TreeListBox.OnItemsSourceChanged(IEnumerable, IEnumerable)
- TreeListBox.AutoExpandItemsOnFilter
- TreeListBox.CanDragItems
- TreeListBox.CanExpandAll
- TreeListBox.DataFilter
- TreeListBox.EmptyContent
- TreeListBox.EmptyContentTemplate
- TreeListBox.IndentIncrement
- TreeListBox.IsDataVirtualizationEnabled
- TreeListBox.IsEmpty
- TreeListBox.IsFilterActive
- TreeListBox.IsRootItemVisible
- TreeListBox.ItemAdapter
- TreeListBox.MultiDragKind
- TreeListBox.PathSeparator
- TreeListBox.RootItem
- TreeListBox.TopLevelIndent
- TreeListBox.CanSelectItemOnFocus
- TreeListBox.MultiSelectionKind
- TreeListBox.SelectionMode
- TreeListBox.SelectedItem
- TreeListBox.SelectedItems
- TreeListBox.AssemblyInfo
- TreeListBox.HasTreeLines
- TreeListBox.FilterApplied
- TreeListBox.IsRootItemVisibleChanged
- TreeListBox.ItemCollapsed
- TreeListBox.ItemCollapsing
- TreeListBox.ItemDefaultActionExecuting
- TreeListBox.ItemExpanded
- TreeListBox.ItemExpanding
- TreeListBox.ItemMenuRequested
- TreeListBox.ItemSelecting
- TreeListBox.RootItemChanged
- TreeListBox.SelectionChanged