Class
TreeViewPanel

GridViewVirtualizingPanel is used to arrange children into single line.

Definition

Namespace:Telerik.Windows.Controls.TreeView

Assembly:Telerik.Windows.Controls.Navigation.dll

Syntax:

cs-api-definition
public class TreeViewPanel : VirtualizingPanel, IScrollInfo

Inheritance: objectTreeViewPanel

Implements: IScrollInfo

Constructors

TreeViewPanel()

Initializes a new instance of the TreeViewPanel class.

Declaration

cs-api-definition
public TreeViewPanel()

Fields

ChildDefaultLengthProperty

Identifies the ChildDefaultLength property.

Declaration

cs-api-definition
public static readonly DependencyProperty ChildDefaultLengthProperty

Field Value

DependencyProperty

CleanUpVirtualizedItemEvent

Called on the ItemsControl that owns this panel when an item is being re-virtualized.

Declaration

cs-api-definition
public static readonly RoutedEvent CleanUpVirtualizedItemEvent

Field Value

RoutedEvent

IsVirtualizingProperty

Attached property for use on the ItemsControl that is the host for the items being presented by this panel. Use this property to turn virtualization on/off.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Virtualizing", Justification = "The spelling is correct.")]
public static readonly DependencyProperty IsVirtualizingProperty

Field Value

DependencyProperty

OrientationProperty

DependencyProperty for Orientation property.

Declaration

cs-api-definition
public static readonly DependencyProperty OrientationProperty

Field Value

DependencyProperty

TreeVirtualizationModeProperty

Attached property for use on the ItemsControl that is the host for the items being presented by this panel. Use this property to modify the virtualization mode. Note that this property can only be set before the panel has been initialized.

Declaration

cs-api-definition
public static readonly DependencyProperty TreeVirtualizationModeProperty

Field Value

DependencyProperty

VirtualizationModeProperty

Attached property for use on the ItemsControl that is the host for the items being presented by this panel. Use this property to modify the virtualization mode.

Note that this property can only be set before the panel has been initialized.

Declaration

cs-api-definition
public static readonly DependencyProperty VirtualizationModeProperty

Field Value

DependencyProperty

Properties

CanHorizontallyScroll

GridViewVirtualizingPanel reacts to this property by changing its child measurement algorithm. If scrolling in a dimension, infinite space is allowed the child; otherwise, available size is preserved.

Declaration

cs-api-definition
public bool CanHorizontallyScroll { get; set; }

Property Value

bool

CanVerticallyScroll

GridViewVirtualizingPanel reacts to this property by changing its child measurement algorithm. If scrolling in a dimension, infinite space is allowed the child; otherwise, available size is preserved.

Declaration

cs-api-definition
public bool CanVerticallyScroll { get; set; }

Property Value

bool

ChildDefaultLength

Gets or sets the expected length (width or height) for the items of the panel. This is a dependency property.

Declaration

cs-api-definition
public double ChildDefaultLength { get; set; }

Property Value

double

Remarks

The value of this property should be as close as possible to the header height of the TreeViewItem.

ExtentHeight

ExtentHeight contains the vertical size of the scrolled content element in 1/96".

Declaration

cs-api-definition
public double ExtentHeight { get; }

Property Value

double

ExtentWidth

ExtentWidth contains the horizontal size of the scrolled content element in 1/96".

Declaration

cs-api-definition
public double ExtentWidth { get; }

Property Value

double

HasLogicalOrientation

This property is always false because this panel has only vertical.

Declaration

cs-api-definition
protected override bool HasLogicalOrientation { get; }

Property Value

bool

HorizontalOffset

HorizontalOffset is the horizontal offset of the scrolled content in 1/96".

Declaration

cs-api-definition
public double HorizontalOffset { get; }

Property Value

double

IsVisualCacheEnabled

Determines whether the panel should cache its visual items or not. Caching improves scrolling performance but may affect memory usage.

Declaration

cs-api-definition
public bool IsVisualCacheEnabled { get; set; }

Property Value

bool

LogicalOrientation

Orientation of the panel if its layout is in one dimension. Otherwise HasLogicalOrientation is false and LogicalOrientation should be ignored.

Declaration

cs-api-definition
protected override Orientation LogicalOrientation { get; }

Property Value

Orientation

ScrollOwner

ScrollOwner is the container that controls any scrollbars, headers, etc... that are dependant on this IScrollInfo's properties.

Declaration

cs-api-definition
public ScrollViewer ScrollOwner { get; set; }

Property Value

ScrollViewer

VerticalOffset

VerticalOffset is the vertical offset of the scrolled content in 1/96".

Declaration

cs-api-definition
public double VerticalOffset { get; }

Property Value

double

ViewportHeight

ViewportHeight contains the vertical size of content's visible range in 1/96" .

Declaration

cs-api-definition
public double ViewportHeight { get; }

Property Value

double

ViewportWidth

ViewportWidth contains the horizontal size of content's visible range in 1/96".

Declaration

cs-api-definition
public double ViewportWidth { get; }

Property Value

double

Methods

AddCleanUpVirtualizedItemHandler(DependencyObject, CleanUpVirtualizedItemEventHandler)

Adds a handler for the CleanUpVirtualizedItem attached event.

Declaration

cs-api-definition
public static void AddCleanUpVirtualizedItemHandler(DependencyObject element, CleanUpVirtualizedItemEventHandler handler)

Parameters

element

DependencyObject

DependencyObject that listens to this event.

handler

CleanUpVirtualizedItemEventHandler

Event Handler to be added.

ArrangeOverride(Size)

Arranges the override.

Declaration

cs-api-definition
protected override Size ArrangeOverride(Size finalSize)

Parameters

finalSize

Size

Size of the arrange.

Returns

Size

BringIndexIntoView(int)

Generates the item at the specified index and calls BringIntoView on it.

Declaration

cs-api-definition
protected override void BringIndexIntoView(int index)

Parameters

index

int

Specify the item index that should become visible.

Exceptions

ArgumentOutOfRangeException

Thrown if index is out of range.

GetIsVirtualizing(DependencyObject)

Retrieves the value for IsVirtualizingProperty.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Virtualizing", Justification = "The spelling is correct.")]
public static bool GetIsVirtualizing(DependencyObject element)

Parameters

element

DependencyObject

The object on which to query the value.

Returns

bool

True if virtualizing, false otherwise.

GetTreeVirtualizationMode(DependencyObject)

Retrieves the value for TreeVirtualizationModeProperty.

Declaration

cs-api-definition
public static VirtualizationMode GetTreeVirtualizationMode(DependencyObject element)

Parameters

element

DependencyObject

The object on which to query the value.

Returns

VirtualizationMode

The current virtualization mode.

GetVirtualizationMode(DependencyObject)

Retrieves the value for VirtualizationModeProperty.

Declaration

cs-api-definition
public static VirtualizationMode GetVirtualizationMode(DependencyObject element)

Parameters

element

DependencyObject

The object on which to query the value.

Returns

VirtualizationMode

The current virtualization mode.

LineDown()

Scroll content by one line to the bottom. Subclasses can override this method and call SetVerticalOffset to change the behavior of what "line" means.

Declaration

cs-api-definition
public virtual void LineDown()

LineLeft()

Scroll content by one line to the left. Subclasses can override this method and call SetHorizontalOffset to change the behavior of what "line" means.

Declaration

cs-api-definition
public virtual void LineLeft()

LineRight()

Scroll content by one line to the right. Subclasses can override this method and call SetHorizontalOffset to change the behavior of what "line" means.

Declaration

cs-api-definition
public virtual void LineRight()

LineUp()

Scroll content by one line to the top. Subclasses can override this method and call SetVerticalOffset to change the behavior of what "line" means.

Declaration

cs-api-definition
public virtual void LineUp()

MakeVisible(Visual, Rect)

GridViewVirtualizingPanel implementation of .

Declaration

cs-api-definition
public Rect MakeVisible(Visual visual, Rect rectangle)

Parameters

visual

Visual

rectangle

Rect

Returns

Rect

Remarks

The goal is to change offsets to bring the child into view, and return a rectangle in our space to make visible. The rectangle we return is in the physical dimension the input target rect transformed into our pace. In the logical dimension, it is our immediate child's rect.

MeasureOverride(Size)

General GridViewVirtualizingPanel layout behavior is to grow unbounded in the "stacking" direction (Size To Content). Children in this dimension are encouraged to be as large as they like. In the other dimension, GridViewVirtualizingPanel will assume the maximum size of its children.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode", Justification = "Indeed, it should eb refactored.")]
[SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "0#", Justification = "Available size exists as field as well.")]
[SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals")]
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "The method can be simplified at a later stage.")]
protected override Size MeasureOverride(Size constraint)

Parameters

constraint

Size

Constraint.

Returns

Size

Desired size.

Remarks

When scrolling, GridViewVirtualizingPanel will not grow in layout size but effectively add the children on a z-plane which will probably be clipped by some parent (typically a ScrollContentPresenter) to Stack's size.

MouseWheelDown()

Scroll content by one page to the bottom. Subclasses can override this method and call SetVerticalOffset to change the behavior of the mouse wheel increment.

Declaration

cs-api-definition
public virtual void MouseWheelDown()

MouseWheelLeft()

Scroll content by one page to the left. Subclasses can override this method and call SetHorizontalOffset to change the behavior of the mouse wheel increment.

Declaration

cs-api-definition
public virtual void MouseWheelLeft()

MouseWheelRight()

Scroll content by one page to the right. Subclasses can override this method and call SetHorizontalOffset to change the behavior of the mouse wheel increment.

Declaration

cs-api-definition
public virtual void MouseWheelRight()

MouseWheelUp()

Scroll content by one page to the top. Subclasses can override this method and call SetVerticalOffset to change the behavior of the mouse wheel increment.

Declaration

cs-api-definition
public virtual void MouseWheelUp()

OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs)

Called when an item is being re-virtualized.

Declaration

cs-api-definition
protected virtual void OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs e)

Parameters

e

CleanUpVirtualizedItemEventArgs

OnClearChildren()

Called when the UI collection of children is cleared by the base Panel class.

Declaration

cs-api-definition
protected override void OnClearChildren()

OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)

Override of OnGotKeyboardFocus. Called when focus moves to any child or sub child of this VSP Used by MyTreeView virtualization to keep track of the focused item.

Declaration

cs-api-definition
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)

Parameters

e

KeyboardFocusChangedEventArgs

OnItemsChanged(object, ItemsChangedEventArgs)

Called when the Items collection associated with the containing ItemsControl changes.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
[SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals")]
protected override void OnItemsChanged(object sender, ItemsChangedEventArgs args)

Parameters

sender

object

Sender.

args

ItemsChangedEventArgs

Event arguments.

OnLostKeyboardFocus(KeyboardFocusChangedEventArgs)

Override of OnLostKeyboardFocus. Called when focus moves away from this VSP. Used by MyTreeView virtualization to keep track of the focused item.

Declaration

cs-api-definition
protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)

Parameters

e

KeyboardFocusChangedEventArgs

OnViewportSizeChanged(Size, Size)

Allows subclasses to be notified of changes to the viewport size data.

Declaration

cs-api-definition
protected virtual void OnViewportSizeChanged(Size oldViewportSize, Size newViewportSize)

Parameters

oldViewportSize

Size

The old value of the size.

newViewportSize

Size

The new value of the size.

PageDown()

Scroll content by one page to the bottom. Subclasses can override this method and call SetVerticalOffset to change the behavior of what "page" means.

Declaration

cs-api-definition
public virtual void PageDown()

PageLeft()

Scroll content by one page to the left. Subclasses can override this method and call SetHorizontalOffset to change the behavior of what "page" means.

Declaration

cs-api-definition
public virtual void PageLeft()

PageRight()

Scroll content by one page to the right. Subclasses can override this method and call SetHorizontalOffset to change the behavior of what "page" means.

Declaration

cs-api-definition
public virtual void PageRight()

PageUp()

Scroll content by one page to the top. Subclasses can override this method and call SetVerticalOffset to change the behavior of what "page" means.

Declaration

cs-api-definition
public virtual void PageUp()

RemoveCleanUpVirtualizedItemHandler(DependencyObject, CleanUpVirtualizedItemEventHandler)

Removes a handler for the CleanUpVirtualizedItem attached event.

Declaration

cs-api-definition
public static void RemoveCleanUpVirtualizedItemHandler(DependencyObject element, CleanUpVirtualizedItemEventHandler handler)

Parameters

element

DependencyObject

DependencyObject that listens to this event.

handler

CleanUpVirtualizedItemEventHandler

Event Handler to be removed.

SetHorizontalOffset(double)

Set the HorizontalOffset to the passed value.

Declaration

cs-api-definition
public void SetHorizontalOffset(double offset)

Parameters

offset

double

SetIsVirtualizing(DependencyObject, bool)

Sets the value for IsVirtualizingProperty.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Virtualizing", Justification = "The spelling is correct.")]
public static void SetIsVirtualizing(DependencyObject element, bool value)

Parameters

element

DependencyObject

The element on which to set the value.

value

bool

True if virtualizing, false otherwise.

SetTreeVirtualizationMode(DependencyObject, VirtualizationMode)

Sets the value for TreeVirtualizationModeProperty.

Declaration

cs-api-definition
public static void SetTreeVirtualizationMode(DependencyObject element, VirtualizationMode value)

Parameters

element

DependencyObject

The element on which to set the value.

value

VirtualizationMode

The desired virtualization mode.

SetVerticalOffset(double)

Set the VerticalOffset to the passed value.

Declaration

cs-api-definition
public void SetVerticalOffset(double offset)

Parameters

offset

double

SetVirtualizationMode(DependencyObject, VirtualizationMode)

Sets the value for VirtualizationModeProperty.

Declaration

cs-api-definition
public static void SetVirtualizationMode(DependencyObject element, VirtualizationMode value)

Parameters

element

DependencyObject

The element on which to set the value.

value

VirtualizationMode

The desired virtualization mode.