Viewport2DVisual3D Class
Renders the 2-D children within the specified 3-D viewport bounds.
Assembly: PresentationCore (in PresentationCore.dll)
System.Windows.Threading::DispatcherObject
System.Windows::DependencyObject
System.Windows.Media.Media3D::Visual3D
System.Windows.Media.Media3D::Viewport2DVisual3D
| Name | Description | |
|---|---|---|
![]() | Viewport2DVisual3D() | Initializes a new instance of the Viewport2DVisual3D class. |
| Name | Description | |
|---|---|---|
![]() | CacheMode | Gets or sets a cached representation of the Viewport2DVisual3D. |
![]() | DependencyObjectType | Gets the DependencyObjectType that wraps the CLR type of this instance. (Inherited from DependencyObject.) |
![]() | Dispatcher | Gets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.) |
![]() | Geometry | Gets or sets the 3-D geometry for this Viewport2DVisual3D. |
![]() | HasAnimatedProperties | |
![]() | IsSealed | Gets a value that indicates whether this instance is currently sealed (read-only).(Inherited from DependencyObject.) |
![]() | Material | Gets or sets the material that describes the appearance of the 3-D object. |
![]() | Transform | Gets or sets the transformation that is applied to the 3-D object.(Inherited from Visual3D.) |
![]() | Visual | Gets or sets the 2-D visual to be placed on the 3-D object. |
| Name | Description | |
|---|---|---|
![]() ![]() | IsVisualHostMaterial | Gets or sets a value that specifies whether a material should be interactive. |
| Name | Description | |
|---|---|---|
![]() | ApplyAnimationClock(DependencyProperty^, AnimationClock^) | Applies the effect of a given AnimationClock to a given dependency property.(Inherited from Visual3D.) |
![]() | ApplyAnimationClock(DependencyProperty^, AnimationClock^, HandoffBehavior) | Applies the effect of a given AnimationClock to a given dependency property. The effect of the new AnimationClock on any current animations is determined by the value of the handoffBehavior parameter.(Inherited from Visual3D.) |
![]() | BeginAnimation(DependencyProperty^, AnimationTimeline^) | Initiates an animation sequence for the DependencyProperty object, based on the specified AnimationTimeline.(Inherited from Visual3D.) |
![]() | BeginAnimation(DependencyProperty^, AnimationTimeline^, HandoffBehavior) | Initiates an animation sequence for the DependencyProperty object, based on both the specified AnimationTimeline and HandoffBehavior.(Inherited from Visual3D.) |
![]() | 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.) |
![]() | FindCommonVisualAncestor(DependencyObject^) | Returns the common ancestor of the visual object and another specified visual object.(Inherited from Visual3D.) |
![]() | GetAnimationBaseValue(DependencyProperty^) | Retrieves the base value of the specified DependencyProperty object.(Inherited from Visual3D.) |
![]() | GetHashCode() | Gets a hash code for this DependencyObject.(Inherited from DependencyObject.) |
![]() ![]() | GetIsVisualHostMaterial(Material^) | Gets the value of the IsVisualHostMaterial attached property for a specified UIElement. |
![]() | 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.) |
![]() | 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 Visual3D.) |
![]() | IsDescendantOf(DependencyObject^) | Determines whether the visual object is a descendant of the ancestor visual object. (Inherited from Visual3D.) |
![]() | OnVisualChildrenChanged(DependencyObject^, DependencyObject^) | Called when the Visual3DCollection of the visual object is modified.(Inherited from Visual3D.) |
![]() | OnVisualParentChanged(DependencyObject^) | Called when the parent of the 3-D visual object is changed.(Inherited from Visual3D.) |
![]() | ReadLocalValue(DependencyProperty^) | Returns the local value of a dependency property, if it exists. (Inherited from DependencyObject.) |
![]() | SetCurrentValue(DependencyProperty^, Object^) | Sets the value of a dependency property without changing its value source. (Inherited from DependencyObject.) |
![]() ![]() | SetIsVisualHostMaterial(Material^, Boolean) | Sets the value of the IsVisualHostMaterial attached property to a specified element. |
![]() | 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(Visual3D^) | |
![]() | VerifyAccess() | Enforces that the calling thread has access to this DispatcherObject.(Inherited from DispatcherObject.) |
| Name | Description | |
|---|---|---|
![]() ![]() | CacheModeProperty | Identifies the CacheMode dependency property. |
![]() ![]() | GeometryProperty | Identifies the Geometry dependency property. |
![]() ![]() | IsVisualHostMaterialProperty | Identifies the IsVisualHostMaterial attached property. |
![]() ![]() | MaterialProperty | Identifies the Material dependency property. |
![]() ![]() | VisualProperty | Identifies the Visual dependency property. |
Viewport2DVisual3D enables you to place interactive 2-D content on a 3-D object. Its counterpart is the Viewport3DVisual class, which is a 2-D visual with 3-D children.
Viewport2DVisual3D is introduced in the .NET Framework version 3.5.
The following example shows how to place a button, a 2-D object, on a 3-D object. Note that you must set the IsVisualHostMaterial attached property on the material on which you wish to have the 2-D visual placed.
<Viewport3D> <Viewport3D.Camera> <PerspectiveCamera Position="0, 0, 4"/> </Viewport3D.Camera> <!-- Button on 3D --> <Viewport2DVisual3D> <!-- Give the plane a slight rotation --> <Viewport2DVisual3D.Transform> <RotateTransform3D> <RotateTransform3D.Rotation> <AxisAngleRotation3D Angle="40" Axis="0, 1, 0" /> </RotateTransform3D.Rotation> </RotateTransform3D> </Viewport2DVisual3D.Transform> <!-- The Geometry, Material, and Visual for the Viewport2DVisual3D --> <Viewport2DVisual3D.Geometry> <MeshGeometry3D Positions="-1,1,0 -1,-1,0 1,-1,0 1,1,0" TextureCoordinates="0,0 0,1 1,1 1,0" TriangleIndices="0 1 2 0 2 3"/> </Viewport2DVisual3D.Geometry> <Viewport2DVisual3D.Material> <DiffuseMaterial Viewport2DVisual3D.IsVisualHostMaterial="True" Brush="White"/> </Viewport2DVisual3D.Material> <Button>Hello, 3D</Button> </Viewport2DVisual3D> <!-- Lights --> <ModelVisual3D> <ModelVisual3D.Content> <DirectionalLight Color="#FFFFFFFF" Direction="0,0,-1"/> </ModelVisual3D.Content> </ModelVisual3D> </Viewport3D>
For the complete sample, see Interactive 2-D on 3-D Sample.
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.




