ContainerVisual Class
![]() |
---|
The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience. |
Manages a collection of Visual objects.
Assembly: PresentationCore (in PresentationCore.dll)
Name | Description | |
---|---|---|
![]() | ContainerVisual() | Creates a new instance of the ContainerVisual class. |
Name | Description | |
---|---|---|
![]() | BitmapEffect | Obsolete. Gets or sets a BitmapEffect value for the ContainerVisual. |
![]() | BitmapEffectInput | Obsolete. Gets or sets a BitmapEffectInput value for the ContainerVisual. |
![]() | CacheMode | Gets or sets a cached representation of the ContainerVisual. |
![]() | Children | Gets the child collection of the ContainerVisual. |
![]() | Clip | Gets or sets the clipping region of the ContainerVisual. |
![]() | ContentBounds | Gets the bounding box for the contents of the ContainerVisual. |
![]() | DependencyObjectType | Gets the DependencyObjectType that wraps the CLR type of this instance. (Inherited from DependencyObject.) |
![]() | DescendantBounds | Gets the union of all the content bounding boxes for all of the descendants of the ContainerVisual, but not including the contents of the ContainerVisual. |
![]() | Dispatcher | Gets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.) |
![]() | Effect | Gets or sets the bitmap effect to apply to the ContainerVisual. |
![]() | IsSealed | Gets a value that indicates whether this instance is currently sealed (read-only).(Inherited from DependencyObject.) |
![]() | Offset | Gets or sets the offset value of the ContainerVisual from its reference point. |
![]() | Opacity | Gets or sets the opacity of the ContainerVisual, based on 0=transparent, 1=opaque. |
![]() | OpacityMask | Gets or sets a brush that specifies a possible opacity mask for the ContainerVisual. |
![]() | Parent | Gets the parent Visual for the ContainerVisual. |
![]() | Transform | Gets or sets the transform that is applied to the ContainerVisual. |
![]() | VisualBitmapEffect | Obsolete. Gets or sets the BitmapEffect value for the Visual.(Inherited from Visual.) |
![]() | VisualBitmapEffectInput | Obsolete. Gets or sets the BitmapEffectInput value for the Visual.(Inherited from Visual.) |
![]() | VisualBitmapScalingMode | Gets or sets the BitmapScalingMode for the Visual.(Inherited from Visual.) |
![]() | VisualCacheMode | |
![]() | VisualChildrenCount | Gets the number of children for the ContainerVisual.(Overrides Visual.VisualChildrenCount.) |
![]() | VisualClearTypeHint | Gets or sets the ClearTypeHint that determines how ClearType is rendered in the Visual.(Inherited from Visual.) |
![]() | VisualClip | |
![]() | VisualEdgeMode | |
![]() | VisualEffect | |
![]() | VisualOffset | Gets or sets the offset value of the visual object.(Inherited from Visual.) |
![]() | VisualOpacity | |
![]() | VisualOpacityMask | |
![]() | VisualParent | Gets the visual tree parent of the visual object.(Inherited from Visual.) |
![]() | VisualScrollableAreaClip | |
![]() | VisualTextHintingMode | Gets or sets the TextHintingMode of the Visual.(Inherited from Visual.) |
![]() | VisualTextRenderingMode | Gets or sets the TextRenderingMode of the Visual.(Inherited from Visual.) |
![]() | VisualTransform | |
![]() | VisualXSnappingGuidelines | Gets or sets the x-coordinate (vertical) guideline collection.(Inherited from Visual.) |
![]() | VisualYSnappingGuidelines | Gets or sets the y-coordinate (horizontal) guideline collection.(Inherited from Visual.) |
![]() | XSnappingGuidelines | Gets or sets the X (horizontal) guideline for the ContainerVisual. |
![]() | YSnappingGuidelines | Gets or sets the Y (vertical) guideline for the ContainerVisual. |
Name | Description | |
---|---|---|
![]() | AddVisualChild(Visual) | Defines the parent-child relationship between two visuals.(Inherited from Visual.) |
![]() | CheckAccess() | Determines whether the calling thread has access to this DispatcherObject.(Inherited from DispatcherObject.) |
![]() | ClearValue(DependencyProperty) | Clears the local value of a property. The property to be cleared is specified by a DependencyProperty identifier. (Inherited from DependencyObject.) |
![]() | ClearValue(DependencyPropertyKey) | Clears the local value of a read-only property. The property to be cleared is specified by a DependencyPropertyKey. (Inherited from DependencyObject.) |
![]() | CoerceValue(DependencyProperty) | Coerces the value of the specified dependency property. This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject.(Inherited from DependencyObject.) |
![]() | Equals(Object) | Determines whether a provided DependencyObject is equivalent to the current DependencyObject.(Inherited from DependencyObject.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | FindCommonVisualAncestor(DependencyObject) | Returns the common ancestor of two visual objects.(Inherited from Visual.) |
![]() | GetHashCode() | Gets a hash code for this DependencyObject.(Inherited from DependencyObject.) |
![]() | GetLocalValueEnumerator() | Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject. (Inherited from DependencyObject.) |
![]() | GetType() | |
![]() | GetValue(DependencyProperty) | Returns the current effective value of a dependency property on this instance of a DependencyObject. (Inherited from DependencyObject.) |
![]() | GetVisualChild(Int32) | Returns a specified child Visual for the parent ContainerVisual.(Overrides Visual.GetVisualChild(Int32).) |
![]() | HitTest(HitTestFilterCallback, HitTestResultCallback, HitTestParameters) | Initiates a hit test on the ContainerVisual by using the HitTestFilterCallback and HitTestResultCallback objects. |
![]() | HitTest(Point) | Returns the top-most visual object of a hit test by specifying a Point. |
![]() | HitTestCore(GeometryHitTestParameters) | Determines whether a geometry value is within the bounds of the visual object.(Inherited from Visual.) |
![]() | HitTestCore(PointHitTestParameters) | Determines whether a point coordinate value is within the bounds of the visual object.(Inherited from Visual.) |
![]() | InvalidateProperty(DependencyProperty) | Re-evaluates the effective value for the specified dependency property(Inherited from DependencyObject.) |
![]() | IsAncestorOf(DependencyObject) | Determines whether the visual object is an ancestor of the descendant visual object.(Inherited from Visual.) |
![]() | IsDescendantOf(DependencyObject) | Determines whether the visual object is a descendant of the ancestor visual object.(Inherited from Visual.) |
![]() | MemberwiseClone() | |
![]() | OnDpiChanged(DpiScale, DpiScale) | Called when the DPI at which this View is rendered changes.(Inherited from Visual.) |
![]() | OnPropertyChanged(DependencyPropertyChangedEventArgs) | Invoked whenever the effective value of any dependency property on this DependencyObject has been updated. The specific dependency property that changed is reported in the event data. (Inherited from DependencyObject.) |
![]() | OnVisualChildrenChanged(DependencyObject, DependencyObject) | Called when the VisualCollection of the visual object is modified.(Inherited from Visual.) |
![]() | OnVisualParentChanged(DependencyObject) | Called when the parent of the visual object is changed.(Inherited from Visual.) |
![]() | PointFromScreen(Point) | |
![]() | PointToScreen(Point) | |
![]() | ReadLocalValue(DependencyProperty) | Returns the local value of a dependency property, if it exists. (Inherited from DependencyObject.) |
![]() | RemoveVisualChild(Visual) | Removes the parent-child relationship between two visuals.(Inherited from Visual.) |
![]() | SetCurrentValue(DependencyProperty, Object) | Sets the value of a dependency property without changing its value source. (Inherited from DependencyObject.) |
![]() | SetValue(DependencyProperty, Object) | Sets the local value of a dependency property, specified by its dependency property identifier. (Inherited from DependencyObject.) |
![]() | SetValue(DependencyPropertyKey, Object) | Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property. (Inherited from DependencyObject.) |
![]() | ShouldSerializeProperty(DependencyProperty) | Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property.(Inherited from DependencyObject.) |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
![]() | TransformToAncestor(Visual) | |
![]() | TransformToAncestor(Visual3D) | |
![]() | TransformToDescendant(Visual) | |
![]() | TransformToVisual(Visual) | |
![]() | VerifyAccess() | Enforces that the calling thread has access to this DispatcherObject.(Inherited from DispatcherObject.) |
The ContainerVisual class is used as a container for a collection of Visual objects. The DrawingVisual class derives from the ContainerVisual class, such that the DrawingVisual class can also contain a collection of visual objects.
The following example shows how to create a ContainerVisual object that is used as the parent for two DrawingVisual objects. Objects that are added to the ContainerVisual object must be added in reverse z-order (bottom to top) to ensure they are rendering in the correct drawing order. In order for the visual tree to be enumerated correctly, the example provides overridden implementations of the GetVisualChild method and VisualChildrenCount property.
' Create a host visual derived from the FrameworkElement class. ' This class provides layout, event handling, and container support for ' the child visual objects. Public Class MyContainerVisualHost Inherits FrameworkElement Private _containerVisual As ContainerVisual Public Sub New(ByVal border As DrawingVisual, ByVal text As DrawingVisual) ' Create a ContainerVisual to hold DrawingVisual children. _containerVisual = New ContainerVisual() ' Add children to ContainerVisual in reverse z-order (bottom to top). _containerVisual.Children.Add(border) _containerVisual.Children.Add(text) ' Create parent-child relationship with host visual and ContainerVisual. Me.AddVisualChild(_containerVisual) End Sub ' Provide a required override for the VisualChildrenCount property. Protected Overrides ReadOnly Property VisualChildrenCount() As Integer Get Return If(_containerVisual Is Nothing, 0, 1) End Get End Property ' Provide a required override for the GetVisualChild method. Protected Overrides Function GetVisualChild(ByVal index As Integer) As Visual If _containerVisual Is Nothing Then Throw New ArgumentOutOfRangeException() End If Return _containerVisual End Function End Class
Available since 3.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.