Show / Hide Table of Contents

Class TreeMap

Represents a control which can display hierarchical data as a set of nested rectangles. Each item in the hierarchy is laid out in a rectangular area of a size proportional to the value associated with the item.

Inheritance
System.Object
DependencyObject
UIElement
FrameworkElement
Control
TreeMap
Inherited Members
Control.EnableBaseControlHandlingOfVisualStates
Control.ManageIsEnabled(Boolean)
Control.Background
Control.BackgroundProperty
Control.BorderBrush
Control.BorderBrushProperty
Control.BorderThickness
Control.BorderThicknessProperty
Control.FontWeight
Control.FontWeightProperty
Control.FontStyle
Control.FontStyleProperty
Control.Foreground
Control.ForegroundProperty
Control.FontFamily
Control.FontFamilyProperty
Control.FontSize
Control.FontSizeProperty
Control.TextDecorations
Control.TextDecorationsProperty
Control.Padding
Control.PaddingProperty
Control.HorizontalContentAlignment
Control.HorizontalContentAlignmentProperty
Control.VerticalContentAlignment
Control.VerticalContentAlignmentProperty
Control.TabIndex
Control.TabIndexProperty
Control.IsTabStop
Control.IsTabStopProperty
Control.TabNavigation
Control.TabNavigationProperty
Control.Template
Control.TemplateProperty
Control.ApplyTemplate()
Control.GetTemplateChild(String)
Control.Focus()
Control.HandlesScrolling
Control.OnGotFocus(RoutedEventArgs)
Control.OnLostFocus(RoutedEventArgs)
Control.CreateDomElement(Object, Object)
Control.CharacterSpacingProperty
Control.CharacterSpacing
Control.FontStretchProperty
Control.FontStretch
Control.OnDrop(DragEventArgs)
Control.OnDragEnter(DragEventArgs)
Control.OnDragLeave(DragEventArgs)
Control.OnTextInputUpdate(TextCompositionEventArgs)
Control.MeasureOverride(Size)
FrameworkElement.LayoutUpdated
FrameworkElement.SizeChanged
FrameworkElement.ResourceLookupMode
FrameworkElement.StyleProperty
FrameworkElement.Style
FrameworkElement.DefaultStyleKeyProperty
FrameworkElement.DefaultStyleKey
FrameworkElement.OverridesDefaultStyleProperty
FrameworkElement.OverridesDefaultStyle
FrameworkElement.OnVisualParentChanged(DependencyObject)
FrameworkElement.VisualChildrenCount
FrameworkElement.GetVisualChild(Int32)
FrameworkElement.Parent
FrameworkElement.AddLogicalChild(Object)
FrameworkElement.RemoveLogicalChild(Object)
FrameworkElement.LogicalChildren
FrameworkElement.TemplatedParent
FrameworkElement.Resources
FrameworkElement.IsLoaded
FrameworkElement.SetBinding(DependencyProperty, BindingBase)
FrameworkElement.SetBinding(DependencyProperty, Binding)
FrameworkElement.GetBindingExpression(DependencyProperty)
FrameworkElement.Cursor
FrameworkElement.CursorProperty
FrameworkElement.FindName(String)
FrameworkElement.Name
FrameworkElement.NameProperty
FrameworkElement.DataContext
FrameworkElement.DataContextProperty
FrameworkElement.DataContextChanged
FrameworkElement.Triggers
FrameworkElement.FlowDirectionProperty
FrameworkElement.FlowDirection
FrameworkElement.LanguageProperty
FrameworkElement.Language
FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
FrameworkElement.Tag
FrameworkElement.TagProperty
FrameworkElement.LoadedEvent
FrameworkElement.Loaded
FrameworkElement.Unloaded
FrameworkElement.BindingValidationError
FrameworkElement.ContextMenuProperty
FrameworkElement.ContextMenu
FrameworkElement.ContextMenuOpening
FrameworkElement.ToolTipProperty
FrameworkElement.ToolTip
FrameworkElement.INTERNAL_OnDetachedFromVisualTree()
FrameworkElement.INTERNAL_OnAttachedToVisualTree()
FrameworkElement.Height
FrameworkElement.HeightProperty
FrameworkElement.Width
FrameworkElement.WidthProperty
FrameworkElement.HorizontalAlignment
FrameworkElement.HorizontalAlignmentProperty
FrameworkElement.VerticalAlignment
FrameworkElement.VerticalAlignmentProperty
FrameworkElement.Margin
FrameworkElement.MarginProperty
FrameworkElement.MinHeight
FrameworkElement.MinHeightProperty
FrameworkElement.MinWidth
FrameworkElement.MinWidthProperty
FrameworkElement.MaxHeight
FrameworkElement.MaxHeightProperty
FrameworkElement.MaxWidth
FrameworkElement.MaxWidthProperty
FrameworkElement.ActualWidthProperty
FrameworkElement.ActualWidth
FrameworkElement.ActualHeightProperty
FrameworkElement.ActualHeight
UIElement.TransformToVisual(UIElement)
UIElement.OnCreateAutomationPeer()
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisible
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.OnMouseWheel(MouseWheelEventArgs)
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.OnMouseEnter(MouseEventArgs)
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.OnMouseLeave(MouseEventArgs)
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.OnTextInput(TextCompositionEventArgs)
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.OnKeyDown(KeyEventArgs)
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Controls.DataVisualization
Assembly: OpenSilver.Controls.DataVisualization.Toolkit.dll
Syntax
[TemplatePart(Name = "Container", Type = typeof(Canvas))]
public class TreeMap : Control, IControl, IFrameworkElement, IUIElement, IDependencyObject
Remarks

You populate a TreeMap by setting its ItemsSource property to the root of the hierarchy you would like to display. The ItemDefinition property must be set to an instance of a TreeMapItemDefinition with appropriate bindings for Value (identifying the value to be used when calculating relative item sizes) and ItemsSource (identifying the collection of children for each item).

Constructors

| Improve this Doc View Source

TreeMap()

Initializes a new instance of the TreeMap class.

Declaration
public TreeMap()

Fields

| Improve this Doc View Source

InterpolatorsProperty

Identifies the Interpolators dependency property.

Declaration
public static readonly DependencyProperty InterpolatorsProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

ItemDefinitionProperty

Identifies the ItemDefinition dependency property.

Declaration
public static readonly DependencyProperty ItemDefinitionProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

ItemDefinitionSelectorProperty

Identifies the ItemDefinitionSelector dependency property.

Declaration
public static readonly DependencyProperty ItemDefinitionSelectorProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

ItemsSourceProperty

Identifies the ItemsSource dependency property.

Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

Interpolators

Gets or sets a value representing a collection of interpolators to use in TreeMap.

Declaration
public Collection<Interpolator> Interpolators { get; set; }
Property Value
Type Description
System.Collections.ObjectModel.Collection<Interpolator>
| Improve this Doc View Source

ItemDefinition

Gets or sets a value representing the template used to display each item.

Declaration
public TreeMapItemDefinition ItemDefinition { get; set; }
Property Value
Type Description
TreeMapItemDefinition
| Improve this Doc View Source

ItemDefinitionSelector

Gets or sets the selector used to choose the item template dynamically.

Declaration
public TreeMapItemDefinitionSelector ItemDefinitionSelector { get; set; }
Property Value
Type Description
TreeMapItemDefinitionSelector
| Improve this Doc View Source

ItemsSource

Gets or sets a value representing the list of hierarchies used to generate content for the TreeMap.

Declaration
public IEnumerable ItemsSource { get; set; }
Property Value
Type Description
System.Collections.IEnumerable

Methods

| Improve this Doc View Source

ArrangeOverride(Size)

Performs the Arrange pass of the layout.

Declaration
protected override Size ArrangeOverride(Size finalSize)
Parameters
Type Name Description
Size finalSize

The final area within the parent that this element should use to arrange itself and its children.

Returns
Type Description
Size

The actual size used.

Overrides
Control.ArrangeOverride(Size)
Remarks

We round rectangles to snap to nearest pixels. We do that to avoid anti-aliasing which results in better appearance. Moreover to get correct layout we would need to use UseLayoutRounding=false which is Silverlight specific. A side effect is that areas for rectangles in the visual tree no longer can be used to compare them as dimensions are not rounded and therefore not precise.

| Improve this Doc View Source

GetContainerForItemOverride(Object, Int32)

Constructs a new instance of an element used to display an item in the tree.

Declaration
protected virtual FrameworkElement GetContainerForItemOverride(object data, int level)
Parameters
Type Name Description
System.Object data

One of the items in the ItemsSource hierarchy.

System.Int32 level

The level of the item in the hierarchy.

Returns
Type Description
FrameworkElement

A new FrameworkElement which will be added to the TreeMap control. If this method returns null the TreeMap will create the item using the ItemDefinition property, or the value returned by TreeMapItemDefinitionSelector if specified.

Remarks

By default TreeMap will use the template set in its ItemDefinition property, or the value returned from GetTemplateForItemOverride if overridden. Override this method to build a custom element.

| Improve this Doc View Source

OnApplyTemplate()

Invoked whenever application code or internal processes call ApplyTemplate. Gets references to the template parts required by this control.

Declaration
public override void OnApplyTemplate()
Overrides
Control.OnApplyTemplate()
| Improve this Doc View Source

OnInterpolatorsPropertyChanged(Collection<Interpolator>, Collection<Interpolator>)

Called when the value of the InterpolatorsProperty property changes. Triggers a recalculation of the layout.

Declaration
protected virtual void OnInterpolatorsPropertyChanged(Collection<Interpolator> oldValue, Collection<Interpolator> newValue)
Parameters
Type Name Description
System.Collections.ObjectModel.Collection<Interpolator> oldValue

The old Interpolators collection.

System.Collections.ObjectModel.Collection<Interpolator> newValue

The new Interpolators collection.

| Improve this Doc View Source

OnItemDefinitionPropertyChanged(TreeMapItemDefinition, TreeMapItemDefinition)

Called when the value of the ItemDefinitionProperty property changes. Triggers a recalculation of the layout.

Declaration
protected virtual void OnItemDefinitionPropertyChanged(TreeMapItemDefinition oldValue, TreeMapItemDefinition newValue)
Parameters
Type Name Description
TreeMapItemDefinition oldValue

The old item definition.

TreeMapItemDefinition newValue

The new item definition.

| Improve this Doc View Source

OnItemDefinitionSelectorPropertyChanged(TreeMapItemDefinitionSelector, TreeMapItemDefinitionSelector)

Called when the value of the ItemDefinitionSelectorProperty property changes. Triggers a recalculation of the layout.

Declaration
protected virtual void OnItemDefinitionSelectorPropertyChanged(TreeMapItemDefinitionSelector oldValue, TreeMapItemDefinitionSelector newValue)
Parameters
Type Name Description
TreeMapItemDefinitionSelector oldValue

The old selector.

TreeMapItemDefinitionSelector newValue

The new selector.

| Improve this Doc View Source

OnItemsSourcePropertyChanged(IEnumerable, IEnumerable)

Called when the value of the ItemsSourceProperty property changes.

Declaration
protected virtual void OnItemsSourcePropertyChanged(IEnumerable oldValue, IEnumerable newValue)
Parameters
Type Name Description
System.Collections.IEnumerable oldValue

The old ItemsSource collection.

System.Collections.IEnumerable newValue

The new ItemsSource collection.

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
VisualTreeExtensions.GetBoundsRelativeTo(FrameworkElement, UIElement)
VisualTreeExtensions.InvokeOnLayoutUpdated(FrameworkElement, Action)
  • Improve this Doc
  • View Source