Rect.Equality(Rect, Rect) 运算符

定义

比较两个 Rect 结构是否相等。

public:
 static bool operator ==(Windows::Foundation::Rect rect1, Windows::Foundation::Rect rect2);
public static bool operator == (Windows.Foundation.Rect rect1, Windows.Foundation.Rect rect2);
static member ( = ) : Windows.Foundation.Rect * Windows.Foundation.Rect -> bool
Public Shared Operator == (rect1 As Rect, rect2 As Rect) As Boolean

参数

rect1
Rect

要比较的第一个矩形。

rect2
Rect

要比较的第二个矩形。

返回

Boolean

如果 Rect 结构具有相同的 x、y、宽度和高度属性值,则为 true;否则为 false

注解

此结构表示 Windows 运行时 (WinRT) 结构的 .NET 投影 Rect 。 有关详细信息,请参阅 UWP API 参考中的 Rect

有关此成员的详细信息和示例,请参阅 Rect.Equality .NET FRAMEWORK API 参考中的。 (示例演示 WPF 用法,可能无法直接转换为 UWP XAML。 )

适用于