Class VisualContainer
VisualContainer maintains a collection of child elements. Adding and removing elements from the children collection does not trigger calls to InvalidateMeasure. This allows adding and removing elements on the fly. A derived control is responsible to call Measure and Arrange on child elements since this base class will not do this by itsself.
Implements
Namespace: Syncfusion.Windows.Controls.Scroll
Assembly: Syncfusion.GridCommon.WPF.dll
Syntax
public class VisualContainer : FrameworkElement, IDisposable
Constructors
VisualContainer()
Initializes a new instance of the VisualContainer class.
Declaration
public VisualContainer()
VisualContainer(String)
Initializes a new instance of the VisualContainer class.
Declaration
public VisualContainer(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Fields
CellRenderBoundsProperty
The value of this property represents the distance between the left side of an element and the left side of its parent Canvas. When the editor inside a cell has children and you query this attached property for a child it will query the top-most parent element of the cell renderer for the value of the property.
Declaration
public static readonly DependencyProperty CellRenderBoundsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
WantsKeyInputProperty
The handle template element property
Declaration
public static readonly DependencyProperty WantsKeyInputProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
WantsMouseInputProperty
MouseControllerDispatcher checks this attached property for the UIElement returned by MouseDevice.DirectlyOver when the user hovers the mouse over an element. When it is true the MouseControllerDispatcher assumes the child UI Element wants to handle mouse events itsself. In such case each MouseController will take this into consideration. The default value is null. TextBox and Checkbox renderers usually set this property to true.
If the property is true the SelectCellsMouseController.HitTest method will return 0 and thus indicating that it will not want to take control. Another MouseController might decide to handle the mouse action anyway and in such case the UIElement will not get the mouse action.
When the value is null the parent element is queried.
When the value is false the parent element is not queried.
Declaration
public static readonly DependencyProperty WantsMouseInputProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
Children
Gets the collection of visual children. Adding and removing elements through the this collection does not trigger calls to InvalidateMeasure.
Declaration
public IList<Visual> Children { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<System.Windows.Media.Visual> | The children. |
VisualChildrenCount
Gets the number of visual child elements within this element.
Declaration
protected override int VisualChildrenCount { get; }
Property Value
Type |
---|
System.Int32 |
Methods
ArrangeOverride(Size)
Returns the same exact same size as specified by finalSize without arranging child elements.
Declaration
protected override Size ArrangeOverride(Size finalSize)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Size | finalSize | The final area within the parent that this element should use to arrange itself and its children. |
Returns
Type | Description |
---|---|
System.Windows.Size | Same size as given in finalSize. |
Dispose()
Declaration
public void Dispose()
GetParent(DependencyObject)
Declaration
public static DependencyObject GetParent(DependencyObject current)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | current |
Returns
Type |
---|
System.Windows.DependencyObject |
GetRenderBounds(DependencyObject)
Declaration
public static Rect GetRenderBounds(DependencyObject dpo)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | dpo |
Returns
Type |
---|
System.Windows.Rect |
GetRenderBoundsInherited(DependencyObject)
Gets the CellRenderBoundsProperty attached dependency property value.
Declaration
public static Rect GetRenderBoundsInherited(DependencyObject dpo)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | dpo | The instance to be queried for the effective value of the dependency property. |
Returns
Type | Description |
---|---|
System.Windows.Rect | Returns the effective value for the given instance. |
GetVisualChild(Int32)
Overrides System.Windows.Media.Visual.GetVisualChild(System.Int32), and returns a child at the specified index from a collection of child elements.
Declaration
protected override Visual GetVisualChild(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index of the requested child element in the collection. |
Returns
Type | Description |
---|---|
System.Windows.Media.Visual | The requested child element. This should not return null; if the provided index is out of range, an exception is thrown. |
GetWantsKeyInput(DependencyObject)
Declaration
public static bool GetWantsKeyInput(DependencyObject dpo)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | dpo |
Returns
Type |
---|
System.Boolean |
GetWantsMouseInput(DependencyObject, UIElement)
Gets the WantsMouseInputProperty attached dependency property value.
Declaration
public static Nullable<bool> GetWantsMouseInput(DependencyObject dpo, UIElement falseIfParent)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | dpo | The instance to be queried for the effective value of the dependency property. |
System.Windows.UIElement | falseIfParent | Abprt search parent elements when the parent matches the given UIElement. |
Returns
Type | Description |
---|---|
System.Nullable<System.Boolean> | Returns the effective value for the given instance. |
HitTestCore(GeometryHitTestParameters)
Implements System.Windows.Media.Visual.HitTestCore(System.Windows.Media.GeometryHitTestParameters) to supply base element hit testing behavior (returning System.Windows.Media.GeometryHitTestResult).
Declaration
protected override GeometryHitTestResult HitTestCore(GeometryHitTestParameters hitTestParameters)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.GeometryHitTestParameters | hitTestParameters | Describes the hit test to perform, including the initial hit point. |
Returns
Type | Description |
---|---|
System.Windows.Media.GeometryHitTestResult | Results of the test, including the evaluated geometry. |
HitTestCore(PointHitTestParameters)
Implements System.Windows.Media.Visual.HitTestCore(System.Windows.Media.PointHitTestParameters) to supply base element hit testing behavior (returning System.Windows.Media.HitTestResult).
Declaration
protected override HitTestResult HitTestCore(PointHitTestParameters hitTestParameters)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.PointHitTestParameters | hitTestParameters | Describes the hit test to perform, including the initial hit point. |
Returns
Type | Description |
---|---|
System.Windows.Media.HitTestResult | Results of the test, including the evaluated point. |
MeasureOverride(Size)
Returns the same exact same size as specified by constraint.
Declaration
protected override Size MeasureOverride(Size constraint)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Size | constraint | The maximum size limit for the control. |
Returns
Type | Description |
---|---|
System.Windows.Size | Same size as given in constraint. |
OnRender(DrawingContext)
When overridden in a derived class, participates in rendering operations that are directed by the layout system. The rendering instructions for this element are not used directly when this method is invoked, and are instead preserved for later asynchronous use by layout and drawing.
Declaration
protected override void OnRender(DrawingContext drawingContext)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.DrawingContext | drawingContext | The drawing instructions for a specific element. This context is provided to the layout system. |
SetRenderBounds(DependencyObject, Rect)
Sets the CellRenderBoundsProperty attached dependency property value.
Declaration
public static void SetRenderBounds(DependencyObject dpo, Rect value)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | dpo | The instance to be assigned the value of the dependency property. |
System.Windows.Rect | value | The value. |
SetWantsKeyInput(DependencyObject, Boolean)
Declaration
public static void SetWantsKeyInput(DependencyObject dpo, bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | dpo | |
System.Boolean | value |
SetWantsMouseInput(DependencyObject, Nullable<Boolean>)
Sets the WantsMouseInputProperty attached dependency property value.
Declaration
public static void SetWantsMouseInput(DependencyObject dpo, Nullable<bool> value)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | dpo | The instance to be assigned the value of the dependency property. |
System.Nullable<System.Boolean> | value | The value. |