Compartir a través de


Size3D.X Propiedad

Definición

Obtiene o establece el valor X de esta estructura Size3D.

public:
 property double X { double get(); void set(double value); };
public double X { get; set; }
member this.X : double with get, set
Public Property X As Double

Valor de propiedad

Valor X de esta estructura Size3D. El valor predeterminado es 0.

Ejemplos

En el ejemplo siguiente se muestra cómo comprobar si dos Size3D estructuras son iguales. También muestra cómo asignar valores a una Size3D estructura cuando se declara la estructura y una vez declarada la estructura.

// 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();

// Declaring 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

// Displaying Results
syntaxString = "areEqual = Size3D.Equals(size1, size2);";
resultType = "Boolean";
operationString = "Checking if two Size3D structures are equal";
ShowResults(areEqual.ToString(), syntaxString, resultType, operationString);
' Checks if two Size3D structures are equal using the static Equals method. 
' Returns a Boolean.

' Declaring Size3D structure without initializing x,y,z values
Dim size1 As New Size3D()

' Declaring Size3D structure and initializing x,y,z values
Dim size2 As New Size3D(5, 10, 15)
Dim areEqual As Boolean

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

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

' areEqual is False

' Displaying Results
syntaxString = "areEqual = Size3D.Equals(size1, size2)"
resultType = "Boolean"
operationString = "Checking if two Size3D structures are equal"
ShowResults(areEqual.ToString(), syntaxString, resultType, operationString)

Comentarios

Los Xvalores , Yy Z deben ser no negativos.

Size3D y Rect3D no se usan normalmente en XAML, porque no existen propiedades que se pueden establecer en el modelo de objetos 3D de WPF que usan esos tipos.

Se aplica a