Table of Contents

Class MultiSelectTreeViewBehavior

Namespace
HeBianGu.Base.WpfBase
Assembly
HeBianGu.Base.WpfBase.dll

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

DependencyProperty

SelectedItemsProperty

Selected Items collection

public static readonly DependencyProperty SelectedItemsProperty

Field Value

DependencyProperty

Properties

SelectedItems

Selected Items collection (intended to be data bound)

public IList SelectedItems { get; set; }

Property Value

IList

Methods

GetIsSelected(DependencyObject)

Returns whether the TreeViewItem is selected

public static bool GetIsSelected(DependencyObject obj)

Parameters

obj DependencyObject

Returns

bool

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 DependencyObject
value bool