Size3D Structure

Data structure that describes the size of a three-dimensional object.

Namespace:  System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

[SerializableAttribute]
[TypeConverterAttribute(typeof(Size3DConverter))]
public struct Size3D : IFormattable
 

The Size3D type exposes the following members.

  NameDescription
Public methodSize3DInitializes a new instance of the Size3D structure.
Top

  NameDescription
Public propertyStatic memberEmptyGets a value that represents an empty Size3D structure.
Public propertyIsEmptyGets a value that indicates whether this Size3D structure is empty.
Public propertyXGets or sets the X value of this Size3D structure.
Public propertyY Gets or sets the Y value of this Size3D structure.
Public propertyZ Gets or sets the Z value of this Size3D structure.
Top

  NameDescription
Public methodEquals(Object) Determines whether the specified object is a Size3D structure and whether the X, Y and Z properties of the specified Object are equal to the X, Y and Z properties of this Size3D structure. (Overrides ValueType.Equals(Object).)
Public methodEquals(Size3D)Compares two Size3D structures for equality.
Public methodStatic memberEquals(Size3D, Size3D)Compares two Size3D structures for equality. Two Size3D structures are equal if the values of their X, Y, and Z properties are the same.
Public methodGetHashCodeReturns a hash code for this Size3D structure. (Overrides ValueType.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberParseConverts a String representation of a three-dimensional size structure into the equivalent Size3D structure.
Public methodToString()Creates a String representation of this Size3D structure. (Overrides ValueType.ToString().)
Public methodToString(IFormatProvider)Creates a String representation of this Size3D structure.
Top

  NameDescription
Public operatorStatic memberEqualityCompares two Size3D structures for equality. Two Size3D structures are equal if the values of their X, Y, and Z properties are the same.
Public operatorStatic memberExplicit(Size3D to Point3D)Converts this Size3D structure into a Point3D structure.
Public operatorStatic memberExplicit(Size3D to Vector3D)Converts this Size3D structure into a Vector3D structure.
Public operatorStatic memberInequality Compares two Size3D structures for inequality. Two Size3D structures are not equal if the values of their X, Y and Z properties are different.
Top

  NameDescription
Explicit interface implemetationPrivate methodIFormattable.ToStringThis member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. For a description of this member, see ToString.
Top

Size3D and Rect3D are not typically used in XAML, because no settable properties exist in the WPF 3D object model that use those types.

This example shows how to determine if two Size3D structures are equal using the Size3D static Equals method.

The following code illustrates how to check Size3D structures for equality. The Size3D structures are declared and assigned values. The Equals method is then used to determine if the two structures are equal.

private bool size3DEqualityExample()
{

    // Checks if two Size3D structures are equal using the static Equals method.  
    // Returns a Boolean. 

    // Declaring Size3D structure without initializing x,y,z values
    Size3D size1 = new Size3D();

    // Delcaring Size3D structure and initializing x,y,z values
    Size3D size2 = new Size3D(5, 10, 15);
    Boolean areEqual;

    // Assigning values to size1
    size1.X = 2;
    size1.Y = 4;
    size1.Z = 6;

    // checking for equality
    areEqual = Size3D.Equals(size1, size2);

    // areEqual is False 
    return areEqual;

}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft