Class MultiSelectTreeViewBehavior
Behavior to support multi-select in a traditional WPF TreeView control.
public class MultiSelectTreeViewBehavior : Behavior<TreeView>, IAnimatable, IAttachedObject
- Inheritance
-
MultiSelectTreeViewBehavior
- Implements
- Inherited Members
- Extension Methods
Examples
<TreeView ...> <i:Interaction.Behaviors> <b:MultiSelectTreeViewBehavior SelectedItems="{Binding SelectedItems}" /> </i:Interaction.Behaviors> </TreeView>
Fields
IsSelectedProperty
Selection attached property - can be used for styling TreeViewItem elements.
public static readonly DependencyProperty IsSelectedProperty
Field Value
SelectedItemsProperty
Selected Items collection
public static readonly DependencyProperty SelectedItemsProperty
Field Value
Properties
SelectedItems
Selected Items collection (intended to be data bound)
public IList SelectedItems { get; set; }
Property Value
Methods
GetIsSelected(DependencyObject)
Returns whether the TreeViewItem is selected
public static bool GetIsSelected(DependencyObject obj)
Parameters
obj
DependencyObject
Returns
OnAttached()
Called after the behavior is attached to an AssociatedObject.
protected override void OnAttached()
Remarks
Override this to hook up functionality to the AssociatedObject.
OnDetaching()
Called when the behavior is being detached from its AssociatedObject, but before it has actually occurred.
protected override void OnDetaching()
Remarks
Override this to unhook functionality from the AssociatedObject.
SetIsSelected(DependencyObject, bool)
Changes the selection state of the TreeViewItem.
public static void SetIsSelected(DependencyObject obj, bool value)
Parameters
obj
DependencyObjectvalue
bool