Size3D.X 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
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
属性值
示例
以下示例演示如何检查两个 Size3D 结构是否相等。 它还演示如何在声明结构时和声明结构后向结构赋值 Size3D 。
// 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)
注解
Size3D 和 Rect3D 通常不在 XAML 中使用,因为使用这些类型的 WPF 3D 对象模型中不存在可设置的属性。