ClassTreeViewPanel
GridViewVirtualizingPanel is used to arrange children into single line.
Definition
Namespace:Telerik.Windows.Controls.TreeView
Assembly:Telerik.Windows.Controls.Navigation.dll
Syntax:
public class TreeViewPanel : VirtualizingPanel, IScrollInfo
Inheritance: objectTreeViewPanel
Implements:
Constructors
TreeViewPanel()
Initializes a new instance of the TreeViewPanel class.
Declaration
public TreeViewPanel()
Fields
ChildDefaultLengthProperty
Identifies the ChildDefaultLength property.
Declaration
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
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
[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
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
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
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.
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.
ChildDefaultLength
Gets or sets the expected length (width or height) for the items of the panel. This is a dependency property.
Declaration
public double ChildDefaultLength { get; set; }
Property Value
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".
ExtentWidth
ExtentWidth contains the horizontal size of the scrolled content element in 1/96".
HasLogicalOrientation
This property is always false because this panel has only vertical.
Declaration
protected override bool HasLogicalOrientation { get; }
Property Value
HorizontalOffset
HorizontalOffset is the horizontal offset of the scrolled content in 1/96".
IsVisualCacheEnabled
Determines whether the panel should cache its visual items or not. Caching improves scrolling performance but may affect memory usage.
LogicalOrientation
Orientation of the panel if its layout is in one dimension. Otherwise HasLogicalOrientation is false and LogicalOrientation should be ignored.
Declaration
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
public ScrollViewer ScrollOwner { get; set; }
Property Value
ScrollViewer
VerticalOffset
VerticalOffset is the vertical offset of the scrolled content in 1/96".
ViewportHeight
ViewportHeight contains the vertical size of content's visible range in 1/96" .
ViewportWidth
ViewportWidth contains the horizontal size of content's visible range in 1/96".
Methods
AddCleanUpVirtualizedItemHandler(DependencyObject, CleanUpVirtualizedItemEventHandler)
Adds a handler for the CleanUpVirtualizedItem attached event.
Declaration
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
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
protected override void BringIndexIntoView(int index)
Parameters
index
Specify the item index that should become visible.
Exceptions
Thrown if index is out of range.
GetIsVirtualizing(DependencyObject)
Retrieves the value for IsVirtualizingProperty.
Declaration
[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
True if virtualizing, false otherwise.
GetTreeVirtualizationMode(DependencyObject)
Retrieves the value for TreeVirtualizationModeProperty.
Declaration
public static VirtualizationMode GetTreeVirtualizationMode(DependencyObject element)
Parameters
element
DependencyObject
The object on which to query the value.
Returns
The current virtualization mode.
GetVirtualizationMode(DependencyObject)
Retrieves the value for VirtualizationModeProperty.
Declaration
public static VirtualizationMode GetVirtualizationMode(DependencyObject element)
Parameters
element
DependencyObject
The object on which to query the value.
Returns
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
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
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
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
public virtual void LineUp()
MakeVisible(Visual, Rect)
GridViewVirtualizingPanel implementation of .
Declaration
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
[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
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
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
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
public virtual void MouseWheelUp()
OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs)
Called when an item is being re-virtualized.
Declaration
protected virtual void OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs e)
Parameters
e
OnClearChildren()
Called when the UI collection of children is cleared by the base Panel class.
Declaration
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
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
Parameters
e
KeyboardFocusChangedEventArgs
OnItemsChanged(object, ItemsChangedEventArgs)
Called when the Items collection associated with the containing ItemsControl changes.
Declaration
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
[SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals")]
protected override void OnItemsChanged(object sender, ItemsChangedEventArgs args)
Parameters
sender
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
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
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
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
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
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
public virtual void PageUp()
RemoveCleanUpVirtualizedItemHandler(DependencyObject, CleanUpVirtualizedItemEventHandler)
Removes a handler for the CleanUpVirtualizedItem attached event.
Declaration
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
public void SetHorizontalOffset(double offset)
Parameters
offset
SetIsVirtualizing(DependencyObject, bool)
Sets the value for IsVirtualizingProperty.
Declaration
[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
True if virtualizing, false otherwise.
SetTreeVirtualizationMode(DependencyObject, VirtualizationMode)
Sets the value for TreeVirtualizationModeProperty.
Declaration
public static void SetTreeVirtualizationMode(DependencyObject element, VirtualizationMode value)
Parameters
element
DependencyObject
The element on which to set the value.
value
The desired virtualization mode.
SetVerticalOffset(double)
Set the VerticalOffset to the passed value.
SetVirtualizationMode(DependencyObject, VirtualizationMode)
Sets the value for VirtualizationModeProperty.
Declaration
public static void SetVirtualizationMode(DependencyObject element, VirtualizationMode value)
Parameters
element
DependencyObject
The element on which to set the value.
value
The desired virtualization mode.