Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
2246 lines (1964 sloc) 130 KB
<Type Name="Rect" FullName="System.Windows.Rect">
<TypeSignature Language="C#" Value="public struct Rect : IFormattable" />
<TypeSignature Language="ILAsm" Value=".class public sequential ansi serializable sealed beforefieldinit Rect extends System.ValueType implements class System.IFormattable" />
<TypeSignature Language="DocId" Value="T:System.Windows.Rect" />
<TypeSignature Language="VB.NET" Value="Public Structure Rect&#xA;Implements IFormattable" />
<TypeSignature Language="C++ CLI" Value="public value class Rect : IFormattable" />
<TypeSignature Language="F#" Value="type Rect = struct&#xA; interface IFormattable" />
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.ValueType</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.IFormattable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.TypeConverter(typeof(System.Windows.RectConverter))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Windows.Markup.ValueSerializer(typeof(System.Windows.Converters.RectValueSerializer))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Serializable</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Describes the width, height, and location of a rectangle.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<a name="xamlAttributeUsage_Duration"></a>
## XAML Attribute Usage
```
<object property="x,y,width,height"/>
```
<a name="xamlValues_MinWidth"></a>
## XAML Values
*x*
<xref:System.Double?displayProperty=nameWithType>
The x-coordinate location of the left side of the rectangle.
*y*
<xref:System.Double?displayProperty=nameWithType>
The y-coordinate location of the top side of the rectangle.
*width*
<xref:System.Double?displayProperty=nameWithType>
A non-negative value that represents the <xref:System.Windows.Rect.Width%2A> of the rectangle.
*height*
<xref:System.Double?displayProperty=nameWithType>
A non-negative value that represents the <xref:System.Windows.Rect.Height%2A> of the rectangle.
## Examples
The following example shows how to use a <xref:System.Windows.Rect> structure to specify the dimensions and location of a rectangle using XAML.
[!code-csharp[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/CSharp/RectExample.cs#rectexamplewholepage)]
[!code-vb[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/visualbasic/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/visualbasic/rectexample.vb#rectexamplewholepage)]
[!code-xaml[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/xaml/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/XAML/RectExample.xaml#rectexamplewholepage)]
The following example shows how to use code to create a rectangle and add it to the page. The example also illustrates how to find size and coordinate information about the new rectangle and render the information in a <xref:System.Windows.Controls.TextBox> below the rectangle.
[!code-csharp[RectExamples_snip#CreateRectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample1_csharp)]
]]></format>
</remarks>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Rect" /> structure.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public Rect (System.Windows.Size size);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.Windows.Size size) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.#ctor(System.Windows.Size)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; Rect(System::Windows::Size size);" />
<MemberSignature Language="F#" Value="new System.Windows.Rect : System.Windows.Size -&gt; System.Windows.Rect" Usage="new System.Windows.Rect size" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="size" Type="System.Windows.Size" />
</Parameters>
<Docs>
<param name="size">A <see cref="T:System.Windows.Size" /> structure that specifies the width and height of the rectangle.</param>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Rect" /> structure that is of the specified size and is located at (0,0).</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to create a new <xref:System.Windows.Rect> structure by using the <xref:System.Windows.Rect.%23ctor%28System.Windows.Size%29> constructor.
[!code-csharp[RectExamples_snip#CreateRectExample2_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample2_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public Rect (System.Windows.Point point1, System.Windows.Point point2);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.Windows.Point point1, valuetype System.Windows.Point point2) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.#ctor(System.Windows.Point,System.Windows.Point)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (point1 As Point, point2 As Point)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; Rect(System::Windows::Point point1, System::Windows::Point point2);" />
<MemberSignature Language="F#" Value="new System.Windows.Rect : System.Windows.Point * System.Windows.Point -&gt; System.Windows.Rect" Usage="new System.Windows.Rect (point1, point2)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="point1" Type="System.Windows.Point" />
<Parameter Name="point2" Type="System.Windows.Point" />
</Parameters>
<Docs>
<param name="point1">The first point that the new rectangle must contain.</param>
<param name="point2">The second point that the new rectangle must contain.</param>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Rect" /> structure that is exactly large enough to contain the two specified points.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to create a new <xref:System.Windows.Rect> structure by using the <xref:System.Windows.Rect.%23ctor%28System.Windows.Point%2CSystem.Windows.Point%29> constructor.
[!code-csharp[RectExamples_snip#CreateRectExample3_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample3_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public Rect (System.Windows.Point location, System.Windows.Size size);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.Windows.Point location, valuetype System.Windows.Size size) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.#ctor(System.Windows.Point,System.Windows.Size)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; Rect(System::Windows::Point location, System::Windows::Size size);" />
<MemberSignature Language="F#" Value="new System.Windows.Rect : System.Windows.Point * System.Windows.Size -&gt; System.Windows.Rect" Usage="new System.Windows.Rect (location, size)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="location" Type="System.Windows.Point" />
<Parameter Name="size" Type="System.Windows.Size" />
</Parameters>
<Docs>
<param name="location">A point that specifies the location of the top-left corner of the rectangle.</param>
<param name="size">A <see cref="T:System.Windows.Size" /> structure that specifies the width and height of the rectangle.</param>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Rect" /> structure that has the specified top-left corner location and the specified width and height.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to create a new <xref:System.Windows.Rect> structure by using the <xref:System.Windows.Rect.%23ctor%28System.Windows.Point%2CSystem.Windows.Size%29> constructor.
[!code-csharp[RectExamples_snip#CreateRectExample4_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample4_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public Rect (System.Windows.Point point, System.Windows.Vector vector);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.Windows.Point point, valuetype System.Windows.Vector vector) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.#ctor(System.Windows.Point,System.Windows.Vector)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; Rect(System::Windows::Point point, System::Windows::Vector vector);" />
<MemberSignature Language="F#" Value="new System.Windows.Rect : System.Windows.Point * System.Windows.Vector -&gt; System.Windows.Rect" Usage="new System.Windows.Rect (point, vector)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="point" Type="System.Windows.Point" />
<Parameter Name="vector" Type="System.Windows.Vector" />
</Parameters>
<Docs>
<param name="point">The first point the rectangle must contain.</param>
<param name="vector">The amount to offset the specified point. The resulting rectangle will be exactly large enough to contain both points.</param>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Rect" /> structure that is exactly large enough to contain the specified point and the sum of the specified point and the specified vector.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to create a new <xref:System.Windows.Rect> structure by using the <xref:System.Windows.Rect.%23ctor%28System.Windows.Point%2CSystem.Windows.Vector%29> constructor.
[!code-csharp[RectExamples_snip#CreateRectExample5_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample5_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public Rect (double x, double y, double width, double height);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(float64 x, float64 y, float64 width, float64 height) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.#ctor(System.Double,System.Double,System.Double,System.Double)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (x As Double, y As Double, width As Double, height As Double)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; Rect(double x, double y, double width, double height);" />
<MemberSignature Language="F#" Value="new System.Windows.Rect : double * double * double * double -&gt; System.Windows.Rect" Usage="new System.Windows.Rect (x, y, width, height)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="x" Type="System.Double" />
<Parameter Name="y" Type="System.Double" />
<Parameter Name="width" Type="System.Double" />
<Parameter Name="height" Type="System.Double" />
</Parameters>
<Docs>
<param name="x">The x-coordinate of the top-left corner of the rectangle.</param>
<param name="y">The y-coordinate of the top-left corner of the rectangle.</param>
<param name="width">The width of the rectangle.</param>
<param name="height">The height of the rectangle.</param>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Rect" /> structure that has the specified x-coordinate, y-coordinate, width, and height.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The following example shows how to create a new <xref:System.Windows.Rect> structure by using the <xref:System.Windows.Rect.%23ctor%28System.Double%2CSystem.Double%2CSystem.Double%2CSystem.Double%29> constructor.
[!code-csharp[RectExamples_snip#CreateRectExample6_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample6_csharp)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="width" /> is a negative value.
-or-
<paramref name="height" /> is a negative value.</exception>
</Docs>
</Member>
<Member MemberName="Bottom">
<MemberSignature Language="C#" Value="public double Bottom { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance float64 Bottom" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.Bottom" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Bottom As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property double Bottom { double get(); };" />
<MemberSignature Language="F#" Value="member this.Bottom : double" Usage="System.Windows.Rect.Bottom" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the y-axis value of the bottom of the rectangle.</summary>
<value>The y-axis value of the bottom of the rectangle. If the rectangle is empty, the value is <see cref="F:System.Double.NegativeInfinity" /> .</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The y-axis value of the bottom of the rectangle is equal to the sum of the <xref:System.Windows.Rect.Y%2A> and <xref:System.Windows.Rect.Height%2A> properties.
## Examples
The following example shows how to use code to create a rectangle and add it to the page. The example also illustrates how to find size and coordinate information about the new rectangle and render the information in a <xref:System.Windows.Controls.TextBox> below the rectangle.
[!code-csharp[RectExamples_snip#CreateRectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample1_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BottomLeft">
<MemberSignature Language="C#" Value="public System.Windows.Point BottomLeft { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Point BottomLeft" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.BottomLeft" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property BottomLeft As Point" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Point BottomLeft { System::Windows::Point get(); };" />
<MemberSignature Language="F#" Value="member this.BottomLeft : System.Windows.Point" Usage="System.Windows.Rect.BottomLeft" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Point</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the position of the bottom-left corner of the rectangle</summary>
<value>The position of the bottom-left corner of the rectangle.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The position of the bottom-left corner of the rectangle is equal to (<xref:System.Windows.Rect.X%2A>, <xref:System.Windows.Rect.Y%2A> + <xref:System.Windows.Rect.Height%2A>).
## Examples
The following example shows how to use code to create a rectangle and add it to the page. The example also illustrates how to find size and coordinate information about the new rectangle and render the information in a <xref:System.Windows.Controls.TextBox> below the rectangle.
[!code-csharp[RectExamples_snip#CreateRectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample1_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BottomRight">
<MemberSignature Language="C#" Value="public System.Windows.Point BottomRight { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Point BottomRight" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.BottomRight" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property BottomRight As Point" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Point BottomRight { System::Windows::Point get(); };" />
<MemberSignature Language="F#" Value="member this.BottomRight : System.Windows.Point" Usage="System.Windows.Rect.BottomRight" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Point</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the position of the bottom-right corner of the rectangle.</summary>
<value>The position of the bottom-right corner of the rectangle.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The position of the bottom-right corner of the rectangle is equal to (<xref:System.Windows.Rect.X%2A> + <xref:System.Windows.Rect.Width%2A>, <xref:System.Windows.Rect.Y%2A> + <xref:System.Windows.Rect.Height%2A>).
## Examples
The following example shows how to use code to create a rectangle and add it to the page. The example also illustrates how to find size and coordinate information about the new rectangle and render the information in a <xref:System.Windows.Controls.TextBox> below the rectangle.
[!code-csharp[RectExamples_snip#CreateRectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample1_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="Contains">
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Indicates whether the rectangle contains the specified point or rectangle.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Contains">
<MemberSignature Language="C#" Value="public bool Contains (System.Windows.Point point);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool Contains(valuetype System.Windows.Point point) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Contains(System.Windows.Point)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; bool Contains(System::Windows::Point point);" />
<MemberSignature Language="F#" Value="member this.Contains : System.Windows.Point -&gt; bool" Usage="rect.Contains point" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="point" Type="System.Windows.Point" />
</Parameters>
<Docs>
<param name="point">The point to check.</param>
<summary>Indicates whether the rectangle contains the specified point.</summary>
<returns>
<see langword="true" /> if the rectangle contains the specified point; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Contains%28System.Windows.Point%29> method to determine if the rectangle contains the specified <xref:System.Windows.Point>.
[!code-csharp[RectExamples_snip#ContainsExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#containsexample1_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Contains">
<MemberSignature Language="C#" Value="public bool Contains (System.Windows.Rect rect);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool Contains(valuetype System.Windows.Rect rect) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Contains(System.Windows.Rect)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; bool Contains(System::Windows::Rect rect);" />
<MemberSignature Language="F#" Value="member this.Contains : System.Windows.Rect -&gt; bool" Usage="rect.Contains rect" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rect" Type="System.Windows.Rect" />
</Parameters>
<Docs>
<param name="rect">The rectangle to check.</param>
<summary>Indicates whether the rectangle contains the specified rectangle.</summary>
<returns>
<see langword="true" /> if <paramref name="rect" /> is entirely contained by the rectangle; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Contains%28System.Windows.Rect%29> method to determine if one rectangle is contained by another rectangle.
[!code-csharp[RectExamples_snip#ContainsExample2_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#containsexample2_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Contains">
<MemberSignature Language="C#" Value="public bool Contains (double x, double y);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool Contains(float64 x, float64 y) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Contains(System.Double,System.Double)" />
<MemberSignature Language="VB.NET" Value="Public Function Contains (x As Double, y As Double) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; bool Contains(double x, double y);" />
<MemberSignature Language="F#" Value="member this.Contains : double * double -&gt; bool" Usage="rect.Contains (x, y)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="x" Type="System.Double" />
<Parameter Name="y" Type="System.Double" />
</Parameters>
<Docs>
<param name="x">The x-coordinate of the point to check.</param>
<param name="y">The y-coordinate of the point to check.</param>
<summary>Indicates whether the rectangle contains the specified x-coordinate and y-coordinate.</summary>
<returns>
<see langword="true" /> if (<paramref name="x" />, <paramref name="y" />) is contained by the rectangle; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Contains%28System.Double%2CSystem.Double%29> method to determine if the rectangle contains the point specified by the given x-coordinate and y-coordinate.
[!code-csharp[RectExamples_snip#ContainsExample3_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#containsexample3_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Empty">
<MemberSignature Language="C#" Value="public static System.Windows.Rect Empty { get; }" />
<MemberSignature Language="ILAsm" Value=".property valuetype System.Windows.Rect Empty" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.Empty" />
<MemberSignature Language="VB.NET" Value="Public Shared ReadOnly Property Empty As Rect" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static property System::Windows::Rect Empty { System::Windows::Rect get(); };" />
<MemberSignature Language="F#" Value="member this.Empty : System.Windows.Rect" Usage="System.Windows.Rect.Empty" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Rect</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a special value that represents a rectangle with no position or area.</summary>
<value>The empty rectangle, which has <see cref="P:System.Windows.Rect.X" /> and <see cref="P:System.Windows.Rect.Y" /> property values of <see cref="F:System.Double.PositiveInfinity" />, and has <see cref="P:System.Windows.Rect.Width" /> and <see cref="P:System.Windows.Rect.Height" /> property values of <see cref="F:System.Double.NegativeInfinity" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Avoid mathematical computations involving empty rectangles. Because both <xref:System.Windows.Rect.X%2A> and <xref:System.Windows.Rect.Y%2A> are infinite values, processor operations are severely impaired by these operations. Comparisons involving these values will not affect application performance.
]]></format>
</remarks>
<altmember cref="P:System.Windows.Rect.IsEmpty" />
</Docs>
</Member>
<MemberGroup MemberName="Equals">
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Indicates whether two rectangles are equal.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Equals">
<MemberSignature Language="C#" Value="public override bool Equals (object o);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool Equals(object o) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Equals(System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function Equals (o As Object) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override bool Equals(System::Object ^ o);" />
<MemberSignature Language="F#" Value="override this.Equals : obj -&gt; bool" Usage="rect.Equals o" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="o" Type="System.Object" />
</Parameters>
<Docs>
<param name="o">The object to compare to the current rectangle.</param>
<summary>Indicates whether the specified object is equal to the current rectangle.</summary>
<returns>
<see langword="true" /> if <paramref name="o" /> is a <see cref="T:System.Windows.Rect" /> and has the same <see cref="P:System.Windows.Rect.Location" /> and <see cref="P:System.Windows.Rect.Size" /> values as the current rectangle; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This operation tests for object equality.
In this comparison, two instances of <xref:System.Double.NaN?displayProperty=nameWithType> are considered equal.
> [!NOTE]
> A rectangle's position and dimensions are described by <xref:System.Double> values. Because <xref:System.Double> values can lose precision when operated upon, a comparison between two values that are logically equal might fail.
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Equals%28System.Object%29> method to determine if a rectangle is equal to a specified object.
[!code-csharp[RectExamples_snip#EqualsExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#equalsexample1_csharp)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Rect.op_Equality(System.Windows.Rect,System.Windows.Rect)" />
<altmember cref="M:System.Windows.Rect.op_Inequality(System.Windows.Rect,System.Windows.Rect)" />
</Docs>
</Member>
<Member MemberName="Equals">
<MemberSignature Language="C#" Value="public bool Equals (System.Windows.Rect value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool Equals(valuetype System.Windows.Rect value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Equals(System.Windows.Rect)" />
<MemberSignature Language="VB.NET" Value="Public Function Equals (value As Rect) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; bool Equals(System::Windows::Rect value);" />
<MemberSignature Language="F#" Value="override this.Equals : System.Windows.Rect -&gt; bool" Usage="rect.Equals value" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Windows.Rect" />
</Parameters>
<Docs>
<param name="value">The rectangle to compare to the current rectangle.</param>
<summary>Indicates whether the specified rectangle is equal to the current rectangle.</summary>
<returns>
<see langword="true" /> if the specified rectangle has the same <see cref="P:System.Windows.Rect.Location" /> and <see cref="P:System.Windows.Rect.Size" /> values as the current rectangle; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This operation tests for object equality.
In this comparison, two instances of <xref:System.Double.NaN?displayProperty=nameWithType> are considered equal.
> [!NOTE]
> A rectangle's position and dimensions are described by <xref:System.Double> values. Because <xref:System.Double> values can lose precision when operated upon, a comparison between two values that are logically equal might fail.
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Equals%28System.Windows.Rect%29> method to determine if a rectangle is equal to a specified rectangle.
[!code-csharp[RectExamples_snip#EqualsExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#equalsexample1_csharp)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Rect.op_Equality(System.Windows.Rect,System.Windows.Rect)" />
<altmember cref="M:System.Windows.Rect.op_Inequality(System.Windows.Rect,System.Windows.Rect)" />
</Docs>
</Member>
<Member MemberName="Equals">
<MemberSignature Language="C#" Value="public static bool Equals (System.Windows.Rect rect1, System.Windows.Rect rect2);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool Equals(valuetype System.Windows.Rect rect1, valuetype System.Windows.Rect rect2) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Equals(System.Windows.Rect,System.Windows.Rect)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Equals (rect1 As Rect, rect2 As Rect) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static bool Equals(System::Windows::Rect rect1, System::Windows::Rect rect2);" />
<MemberSignature Language="F#" Value="static member Equals : System.Windows.Rect * System.Windows.Rect -&gt; bool" Usage="System.Windows.Rect.Equals (rect1, rect2)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rect1" Type="System.Windows.Rect" />
<Parameter Name="rect2" Type="System.Windows.Rect" />
</Parameters>
<Docs>
<param name="rect1">The first rectangle to compare.</param>
<param name="rect2">The second rectangle to compare.</param>
<summary>Indicates whether the specified rectangles are equal.</summary>
<returns>
<see langword="true" /> if the rectangles have the same <see cref="P:System.Windows.Rect.Location" /> and <see cref="P:System.Windows.Rect.Size" /> values; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This operation tests for object equality.
In this comparison, two instances of <xref:System.Double.NaN?displayProperty=nameWithType> are considered equal.
> [!NOTE]
> A rectangle's position and dimensions are described by <xref:System.Double> values. Because <xref:System.Double> values can lose precision when operated upon, a comparison between two values that are logically equal might fail.
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Equals%28System.Windows.Rect%2CSystem.Windows.Rect%29> method to determine if one rectangle is equal to another.
[!code-csharp[RectExamples_snip#EqualsExample2_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#equalsexample2_csharp)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Rect.op_Equality(System.Windows.Rect,System.Windows.Rect)" />
<altmember cref="M:System.Windows.Rect.op_Inequality(System.Windows.Rect,System.Windows.Rect)" />
</Docs>
</Member>
<Member MemberName="GetHashCode">
<MemberSignature Language="C#" Value="public override int GetHashCode ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetHashCode() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.GetHashCode" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetHashCode () As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetHashCode();" />
<MemberSignature Language="F#" Value="override this.GetHashCode : unit -&gt; int" Usage="rect.GetHashCode " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates a hash code for the rectangle.</summary>
<returns>A hash code for the current <see cref="T:System.Windows.Rect" /> structure.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method creates a hash code by using the <xref:System.Windows.Rect.X%2A>, <xref:System.Windows.Rect.Y%2A>, <xref:System.Windows.Rect.Width%2A>, and <xref:System.Windows.Rect.Height%2A> property values.
## Examples
The following example shows how to use the <xref:System.Windows.Rect.GetHashCode%2A> method to get the hash code of a <xref:System.Windows.Rect>.
[!code-csharp[RectExamples_snip#GetHashCodeExample_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#gethashcodeexample_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Height">
<MemberSignature Language="C#" Value="public double Height { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance float64 Height" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.Height" />
<MemberSignature Language="VB.NET" Value="Public Property Height As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property double Height { double get(); void set(double value); };" />
<MemberSignature Language="F#" Value="member this.Height : double with get, set" Usage="System.Windows.Rect.Height" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the height of the rectangle.</summary>
<value>A positive number that represents the height of the rectangle. The default is 0.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Rect.Empty%2A> rectangle has a <xref:System.Windows.Rect.Height%2A> of <xref:System.Double.NegativeInfinity>. The <xref:System.Windows.Rect.Empty%2A> rectangle is read-only; its <xref:System.Windows.Rect.Height%2A> cannot not be changed.
## Examples
The following example shows how to use a <xref:System.Windows.Rect> structure to specify the dimensions and location of a rectangle using XAML.
[!code-csharp[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/CSharp/RectExample.cs#rectexamplewholepage)]
[!code-vb[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/visualbasic/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/visualbasic/rectexample.vb#rectexamplewholepage)]
[!code-xaml[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/xaml/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/XAML/RectExample.xaml#rectexamplewholepage)]
The following example shows how to use code to create a rectangle and add it to the page. The example also illustrates how to find size and coordinate information about the new rectangle and render the information in a <xref:System.Windows.Controls.TextBox> below the rectangle.
[!code-csharp[RectExamples_snip#CreateRectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample1_csharp)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<see cref="P:System.Windows.Rect.Height" /> is set to a negative value.</exception>
<exception cref="T:System.InvalidOperationException">
<see cref="P:System.Windows.Rect.Height" /> is set on an <see cref="P:System.Windows.Rect.Empty" /> rectangle.</exception>
<altmember cref="P:System.Windows.Rect.Width" />
</Docs>
</Member>
<MemberGroup MemberName="Inflate">
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Creates a rectangle that results from expanding or shrinking a rectangle by the specified amount.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Inflate">
<MemberSignature Language="C#" Value="public void Inflate (System.Windows.Size size);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Inflate(valuetype System.Windows.Size size) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Inflate(System.Windows.Size)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Inflate(System::Windows::Size size);" />
<MemberSignature Language="F#" Value="member this.Inflate : System.Windows.Size -&gt; unit" Usage="rect.Inflate size" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="size" Type="System.Windows.Size" />
</Parameters>
<Docs>
<param name="size">Specifies the amount to expand the rectangle. The <see cref="T:System.Windows.Size" /> structure's <see cref="P:System.Windows.Size.Width" /> property specifies the amount to increase the rectangle's <see cref="P:System.Windows.Rect.Left" /> and <see cref="P:System.Windows.Rect.Right" /> properties. The <see cref="T:System.Windows.Size" /> structure's <see cref="P:System.Windows.Size.Height" /> property specifies the amount to increase the rectangle's <see cref="P:System.Windows.Rect.Top" /> and <see cref="P:System.Windows.Rect.Bottom" /> properties.</param>
<summary>Expands the rectangle by using the specified <see cref="T:System.Windows.Size" />, in all directions.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Rect.Width%2A> of the resulting rectangle is increased by twice the <xref:System.Windows.Size.Width%2A> of the specified <xref:System.Windows.Size> structure, because both the left and right sides of the rectangle are inflated. Likewise, the <xref:System.Windows.Rect.Height%2A> of the resulting rectangle is increased by twice the <xref:System.Windows.Size.Height%2A> of the specified <xref:System.Windows.Size> structure.
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Inflate%28System.Windows.Size%29> method to increase the size of a rectangle.
[!code-csharp[RectExamples_snip#InflateExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#inflateexample1_csharp)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">This method is called on the <see cref="P:System.Windows.Rect.Empty" /> rectangle.</exception>
<altmember cref="M:System.Windows.Rect.Scale(System.Double,System.Double)" />
</Docs>
</Member>
<Member MemberName="Inflate">
<MemberSignature Language="C#" Value="public void Inflate (double width, double height);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Inflate(float64 width, float64 height) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Inflate(System.Double,System.Double)" />
<MemberSignature Language="VB.NET" Value="Public Sub Inflate (width As Double, height As Double)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Inflate(double width, double height);" />
<MemberSignature Language="F#" Value="member this.Inflate : double * double -&gt; unit" Usage="rect.Inflate (width, height)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="width" Type="System.Double" />
<Parameter Name="height" Type="System.Double" />
</Parameters>
<Docs>
<param name="width">The amount by which to expand or shrink the left and right sides of the rectangle.</param>
<param name="height">The amount by which to expand or shrink the top and bottom sides of the rectangle.</param>
<summary>Expands or shrinks the rectangle by using the specified width and height amounts, in all directions.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Rect.Width%2A> of the resulting rectangle is increased or decreased by twice the specified width offset, because it is applied to both the left and right sides of the rectangle. Likewise, the <xref:System.Windows.Rect.Height%2A> of the resulting rectangle is increased or decreased by twice the specified height.
If the specified width or height shrink the rectangle by more than its current <xref:System.Windows.Rect.Width%2A> or <xref:System.Windows.Rect.Height%2A> - giving the rectangle a negative area - the rectangle becomes the <xref:System.Windows.Rect.Empty%2A> rectangle.
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Inflate%28System.Double%2CSystem.Double%29> method to change the size of a rectangle.
[!code-csharp[RectExamples_snip#InflateExample2_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#inflateexample2_csharp)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">This method is called on the <see cref="P:System.Windows.Rect.Empty" /> rectangle.</exception>
<altmember cref="M:System.Windows.Rect.Scale(System.Double,System.Double)" />
</Docs>
</Member>
<Member MemberName="Inflate">
<MemberSignature Language="C#" Value="public static System.Windows.Rect Inflate (System.Windows.Rect rect, System.Windows.Size size);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Windows.Rect Inflate(valuetype System.Windows.Rect rect, valuetype System.Windows.Size size) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Inflate(System.Windows.Rect,System.Windows.Size)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Windows::Rect Inflate(System::Windows::Rect rect, System::Windows::Size size);" />
<MemberSignature Language="F#" Value="static member Inflate : System.Windows.Rect * System.Windows.Size -&gt; System.Windows.Rect" Usage="System.Windows.Rect.Inflate (rect, size)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Rect</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rect" Type="System.Windows.Rect" />
<Parameter Name="size" Type="System.Windows.Size" />
</Parameters>
<Docs>
<param name="rect">The <see cref="T:System.Windows.Rect" /> structure to modify.</param>
<param name="size">Specifies the amount to expand the rectangle. The <see cref="T:System.Windows.Size" /> structure's <see cref="P:System.Windows.Size.Width" /> property specifies the amount to increase the rectangle's <see cref="P:System.Windows.Rect.Left" /> and <see cref="P:System.Windows.Rect.Right" /> properties. The <see cref="T:System.Windows.Size" /> structure's <see cref="P:System.Windows.Size.Height" /> property specifies the amount to increase the rectangle's <see cref="P:System.Windows.Rect.Top" /> and <see cref="P:System.Windows.Rect.Bottom" /> properties.</param>
<summary>Returns the rectangle that results from expanding the specified rectangle by the specified <see cref="T:System.Windows.Size" />, in all directions.</summary>
<returns>The resulting rectangle.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Rect.Width%2A> of the resulting rectangle is increased by twice the <xref:System.Windows.Size.Width%2A> of the specified <xref:System.Windows.Size> structure, because both the left and right sides of the rectangle are inflated. Likewise, the <xref:System.Windows.Rect.Height%2A> of the resulting rectangle is increased by twice the <xref:System.Windows.Size.Height%2A> of the specified <xref:System.Windows.Size> structure.
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Inflate%28System.Windows.Rect%2CSystem.Windows.Size%29> method to change the size of a rectangle.
[!code-csharp[RectExamples_snip#InflateExample3_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#inflateexample3_csharp)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<paramref name="rect" /> is an <see cref="P:System.Windows.Rect.Empty" /> rectangle.</exception>
<altmember cref="M:System.Windows.Rect.Scale(System.Double,System.Double)" />
</Docs>
</Member>
<Member MemberName="Inflate">
<MemberSignature Language="C#" Value="public static System.Windows.Rect Inflate (System.Windows.Rect rect, double width, double height);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Windows.Rect Inflate(valuetype System.Windows.Rect rect, float64 width, float64 height) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Inflate(System.Windows.Rect,System.Double,System.Double)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Windows::Rect Inflate(System::Windows::Rect rect, double width, double height);" />
<MemberSignature Language="F#" Value="static member Inflate : System.Windows.Rect * double * double -&gt; System.Windows.Rect" Usage="System.Windows.Rect.Inflate (rect, width, height)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Rect</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rect" Type="System.Windows.Rect" />
<Parameter Name="width" Type="System.Double" />
<Parameter Name="height" Type="System.Double" />
</Parameters>
<Docs>
<param name="rect">The <see cref="T:System.Windows.Rect" /> structure to modify.</param>
<param name="width">The amount by which to expand or shrink the left and right sides of the rectangle.</param>
<param name="height">The amount by which to expand or shrink the top and bottom sides of the rectangle.</param>
<summary>Creates a rectangle that results from expanding or shrinking the specified rectangle by the specified width and height amounts, in all directions.</summary>
<returns>The resulting rectangle.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Rect.Width%2A> of the resulting rectangle is increased or decreased by twice the specified width offset, because it is applied to both the left and right sides of the rectangle. Likewise, the <xref:System.Windows.Rect.Height%2A> of the resulting rectangle is increased or decreased by twice the specified height.
If the specified width or height modifiers shrink the rectangle by more than its current <xref:System.Windows.Rect.Width%2A> or <xref:System.Windows.Rect.Height%2A> - giving the rectangle a negative area - this method returns <xref:System.Windows.Rect.Empty%2A?displayProperty=nameWithType>.
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Inflate%28System.Windows.Rect%2CSystem.Double%2CSystem.Double%29> method to change the size of a rectangle.
[!code-csharp[RectExamples_snip#InflateExample4_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#inflateexample4_csharp)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<paramref name="rect" /> is an <see cref="P:System.Windows.Rect.Empty" /> rectangle.</exception>
<altmember cref="M:System.Windows.Rect.Scale(System.Double,System.Double)" />
</Docs>
</Member>
<MemberGroup MemberName="Intersect">
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Finds the intersection of two rectangles.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Intersect">
<MemberSignature Language="C#" Value="public void Intersect (System.Windows.Rect rect);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Intersect(valuetype System.Windows.Rect rect) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Intersect(System.Windows.Rect)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Intersect(System::Windows::Rect rect);" />
<MemberSignature Language="F#" Value="member this.Intersect : System.Windows.Rect -&gt; unit" Usage="rect.Intersect rect" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rect" Type="System.Windows.Rect" />
</Parameters>
<Docs>
<param name="rect">The rectangle to intersect with the current rectangle.</param>
<summary>Finds the intersection of the current rectangle and the specified rectangle, and stores the result as the current rectangle.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If no intersection exists, the current rectangle becomes <xref:System.Windows.Rect.Empty%2A?displayProperty=nameWithType>.
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Intersect%28System.Windows.Rect%29> method to find the intersection of two rectangles and store the result as a rectangle.
[!code-csharp[RectExamples_snip#IntersectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#intersectexample1_csharp)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Rect.IntersectsWith(System.Windows.Rect)" />
</Docs>
</Member>
<Member MemberName="Intersect">
<MemberSignature Language="C#" Value="public static System.Windows.Rect Intersect (System.Windows.Rect rect1, System.Windows.Rect rect2);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Windows.Rect Intersect(valuetype System.Windows.Rect rect1, valuetype System.Windows.Rect rect2) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Intersect(System.Windows.Rect,System.Windows.Rect)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Intersect (rect1 As Rect, rect2 As Rect) As Rect" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Windows::Rect Intersect(System::Windows::Rect rect1, System::Windows::Rect rect2);" />
<MemberSignature Language="F#" Value="static member Intersect : System.Windows.Rect * System.Windows.Rect -&gt; System.Windows.Rect" Usage="System.Windows.Rect.Intersect (rect1, rect2)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Rect</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rect1" Type="System.Windows.Rect" />
<Parameter Name="rect2" Type="System.Windows.Rect" />
</Parameters>
<Docs>
<param name="rect1">The first rectangle to compare.</param>
<param name="rect2">The second rectangle to compare.</param>
<summary>Returns the intersection of the specified rectangles.</summary>
<returns>The intersection of the two rectangles, or <see cref="P:System.Windows.Rect.Empty" /> if no intersection exists.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The following example shows how to use the <xref:System.Windows.Rect.Intersect%28System.Windows.Rect%2CSystem.Windows.Rect%29> method to find the intersection of two rectangles.
[!code-csharp[RectExamples_snip#IntersectExample2_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#intersectexample2_csharp)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Rect.IntersectsWith(System.Windows.Rect)" />
</Docs>
</Member>
<Member MemberName="IntersectsWith">
<MemberSignature Language="C#" Value="public bool IntersectsWith (System.Windows.Rect rect);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool IntersectsWith(valuetype System.Windows.Rect rect) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.IntersectsWith(System.Windows.Rect)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; bool IntersectsWith(System::Windows::Rect rect);" />
<MemberSignature Language="F#" Value="member this.IntersectsWith : System.Windows.Rect -&gt; bool" Usage="rect.IntersectsWith rect" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rect" Type="System.Windows.Rect" />
</Parameters>
<Docs>
<param name="rect">The rectangle to check.</param>
<summary>Indicates whether the specified rectangle intersects with the current rectangle.</summary>
<returns>
<see langword="true" /> if the specified rectangle intersects with the current rectangle; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use the <xref:System.Windows.Rect.IntersectsWith%2A> method to determine if two rectangles intersect.
[!code-csharp[RectExamples_snip#IntersectsWithExample_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#intersectswithexample_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="IsEmpty">
<MemberSignature Language="C#" Value="public bool IsEmpty { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsEmpty" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.IsEmpty" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property IsEmpty As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool IsEmpty { bool get(); };" />
<MemberSignature Language="F#" Value="member this.IsEmpty : bool" Usage="System.Windows.Rect.IsEmpty" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value that indicates whether the rectangle is the <see cref="P:System.Windows.Rect.Empty" /> rectangle.</summary>
<value>
<see langword="true" /> if the rectangle is the <see cref="P:System.Windows.Rect.Empty" /> rectangle; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Do not use this property to test for zero area; a rectangle with zero area is not necessarily the <xref:System.Windows.Rect.Empty%2A> rectangle. For more information, see the <xref:System.Windows.Rect.Empty%2A> property.
]]></format>
</remarks>
<altmember cref="P:System.Windows.Rect.Empty" />
</Docs>
</Member>
<Member MemberName="Left">
<MemberSignature Language="C#" Value="public double Left { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance float64 Left" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.Left" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Left As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property double Left { double get(); };" />
<MemberSignature Language="F#" Value="member this.Left : double" Usage="System.Windows.Rect.Left" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the x-axis value of the left side of the rectangle.</summary>
<value>The x-axis value of the left side of the rectangle.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Getting this property is equivalent to getting the <xref:System.Windows.Rect.X%2A> property.
## Examples
The following example shows how to use code to create a rectangle and add it to the page. The example also illustrates how to find size and coordinate information about the new rectangle and render the information in a <xref:System.Windows.Controls.TextBox> below the rectangle.
[!code-csharp[RectExamples_snip#CreateRectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample1_csharp)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Rect.X" />
</Docs>
</Member>
<Member MemberName="Location">
<MemberSignature Language="C#" Value="public System.Windows.Point Location { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Point Location" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.Location" />
<MemberSignature Language="VB.NET" Value="Public Property Location As Point" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Point Location { System::Windows::Point get(); void set(System::Windows::Point value); };" />
<MemberSignature Language="F#" Value="member this.Location : System.Windows.Point with get, set" Usage="System.Windows.Rect.Location" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Point</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the position of the top-left corner of the rectangle.</summary>
<value>The position of the top-left corner of the rectangle. The default is (0, 0).</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The position of the top-left corner of the rectangle is equal to (<xref:System.Windows.Rect.X%2A>, <xref:System.Windows.Rect.Y%2A>).
## Examples
The following example shows how to use a <xref:System.Windows.Rect> structure to specify the dimensions and location of a rectangle using XAML.
[!code-csharp[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/CSharp/RectExample.cs#rectexamplewholepage)]
[!code-vb[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/visualbasic/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/visualbasic/rectexample.vb#rectexamplewholepage)]
[!code-xaml[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/xaml/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/XAML/RectExample.xaml#rectexamplewholepage)]
The following example shows how to use code to create a rectangle and add it to the page. The example also illustrates how to find size and coordinate information about the new rectangle and render the information in a <xref:System.Windows.Controls.TextBox> below the rectangle.
[!code-csharp[RectExamples_snip#CreateRectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample1_csharp)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<see cref="P:System.Windows.Rect.Location" /> is set on an <see cref="P:System.Windows.Rect.Empty" /> rectangle.</exception>
</Docs>
</Member>
<MemberGroup MemberName="Offset">
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Moves a rectangle by the specified amount.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Offset">
<MemberSignature Language="C#" Value="public void Offset (System.Windows.Vector offsetVector);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Offset(valuetype System.Windows.Vector offsetVector) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Offset(System.Windows.Vector)" />
<MemberSignature Language="VB.NET" Value="Public Sub Offset (offsetVector As Vector)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Offset(System::Windows::Vector offsetVector);" />
<MemberSignature Language="F#" Value="member this.Offset : System.Windows.Vector -&gt; unit" Usage="rect.Offset offsetVector" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="offsetVector" Type="System.Windows.Vector" />
</Parameters>
<Docs>
<param name="offsetVector">A vector that specifies the horizontal and vertical amounts to move the rectangle.</param>
<summary>Moves the rectangle by the specified vector.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Calling this method on an empty rectangle (<xref:System.Windows.Rect.Empty%2A?displayProperty=nameWithType>) is not allowed.
Note that calling the <xref:System.Windows.Rect.Offset%2A> method will only have an effect if you can change the <xref:System.Windows.Rect.X%2A> and <xref:System.Windows.Rect.Y%2A> properties directly. Because <xref:System.Windows.Rect> is a value type, if you reference a <xref:System.Windows.Rect> object by using a property or indexer, you get a copy of the object, not a reference to the object. If you attempt to change <xref:System.Windows.Rect.X%2A> or <xref:System.Windows.Rect.Y%2A> on a property or indexer reference, a compiler error occurs. Similarly, calling <xref:System.Windows.Rect.Offset%2A> on the property or indexer will not change the underlying object. If you want to change the value of a <xref:System.Windows.Rect> that is referenced as a property or indexer, create a new <xref:System.Windows.Rect>, modify its fields, and then assign the <xref:System.Windows.Rect> back to the property or indexer.
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Offset%28System.Windows.Vector%29> method to change the position of a rectangle.
[!code-csharp[RectExamples_snip#OffsetExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#offsetexample1_csharp)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">This method is called on the <see cref="P:System.Windows.Rect.Empty" /> rectangle.</exception>
</Docs>
</Member>
<Member MemberName="Offset">
<MemberSignature Language="C#" Value="public void Offset (double offsetX, double offsetY);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Offset(float64 offsetX, float64 offsetY) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Offset(System.Double,System.Double)" />
<MemberSignature Language="VB.NET" Value="Public Sub Offset (offsetX As Double, offsetY As Double)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Offset(double offsetX, double offsetY);" />
<MemberSignature Language="F#" Value="member this.Offset : double * double -&gt; unit" Usage="rect.Offset (offsetX, offsetY)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="offsetX" Type="System.Double" />
<Parameter Name="offsetY" Type="System.Double" />
</Parameters>
<Docs>
<param name="offsetX">The amount to move the rectangle horizontally.</param>
<param name="offsetY">The amount to move the rectangle vertically.</param>
<summary>Moves the rectangle by the specified horizontal and vertical amounts.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Calling this method on an empty rectangle (<xref:System.Windows.Rect.Empty%2A?displayProperty=nameWithType>) is not allowed.
Note that calling the <xref:System.Windows.Rect.Offset%2A> method will only have an effect if you can change the <xref:System.Windows.Rect.X%2A> and <xref:System.Windows.Rect.Y%2A> properties directly. Because <xref:System.Windows.Rect> is a value type, if you reference a <xref:System.Windows.Rect> object by using a property or indexer, you get a copy of the object, not a reference to the object. If you attempt to change <xref:System.Windows.Rect.X%2A> or <xref:System.Windows.Rect.Y%2A> on a property or indexer reference, a compiler error occurs. Similarly, calling <xref:System.Windows.Rect.Offset%2A> on the property or indexer will not change the underlying object. If you want to change the value of a <xref:System.Windows.Rect> that is referenced as a property or indexer, create a new <xref:System.Windows.Rect>, modify its fields, and then assign the <xref:System.Windows.Rect> back to the property or indexer.
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Offset%28System.Double%2CSystem.Double%29> method to change the position of a rectangle.
[!code-csharp[RectExamples_snip#OffsetExample2_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#offsetexample2_csharp)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">This method is called on the <see cref="P:System.Windows.Rect.Empty" /> rectangle.</exception>
</Docs>
</Member>
<Member MemberName="Offset">
<MemberSignature Language="C#" Value="public static System.Windows.Rect Offset (System.Windows.Rect rect, System.Windows.Vector offsetVector);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Windows.Rect Offset(valuetype System.Windows.Rect rect, valuetype System.Windows.Vector offsetVector) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Offset(System.Windows.Rect,System.Windows.Vector)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Windows::Rect Offset(System::Windows::Rect rect, System::Windows::Vector offsetVector);" />
<MemberSignature Language="F#" Value="static member Offset : System.Windows.Rect * System.Windows.Vector -&gt; System.Windows.Rect" Usage="System.Windows.Rect.Offset (rect, offsetVector)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Rect</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rect" Type="System.Windows.Rect" />
<Parameter Name="offsetVector" Type="System.Windows.Vector" />
</Parameters>
<Docs>
<param name="rect">The original rectangle.</param>
<param name="offsetVector">A vector that specifies the horizontal and vertical offsets for the new rectangle.</param>
<summary>Returns a rectangle that is offset from the specified rectangle by using the specified vector.</summary>
<returns>The resulting rectangle.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Calling this method with an empty rectangle (<xref:System.Windows.Rect.Empty%2A?displayProperty=nameWithType>) is not allowed.
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Offset%28System.Windows.Rect%2CSystem.Windows.Vector%29> method to change the position of a rectangle.
[!code-csharp[RectExamples_snip#OffsetExample3_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#offsetexample3_csharp)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<paramref name="rect" /> is <see cref="P:System.Windows.Rect.Empty" />.</exception>
</Docs>
</Member>
<Member MemberName="Offset">
<MemberSignature Language="C#" Value="public static System.Windows.Rect Offset (System.Windows.Rect rect, double offsetX, double offsetY);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Windows.Rect Offset(valuetype System.Windows.Rect rect, float64 offsetX, float64 offsetY) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Offset(System.Windows.Rect,System.Double,System.Double)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Windows::Rect Offset(System::Windows::Rect rect, double offsetX, double offsetY);" />
<MemberSignature Language="F#" Value="static member Offset : System.Windows.Rect * double * double -&gt; System.Windows.Rect" Usage="System.Windows.Rect.Offset (rect, offsetX, offsetY)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Rect</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rect" Type="System.Windows.Rect" />
<Parameter Name="offsetX" Type="System.Double" />
<Parameter Name="offsetY" Type="System.Double" />
</Parameters>
<Docs>
<param name="rect">The rectangle to move.</param>
<param name="offsetX">The horizontal offset for the new rectangle.</param>
<param name="offsetY">The vertical offset for the new rectangle.</param>
<summary>Returns a rectangle that is offset from the specified rectangle by using the specified horizontal and vertical amounts.</summary>
<returns>The resulting rectangle.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Calling this method with an empty rectangle (<xref:System.Windows.Rect.Empty%2A?displayProperty=nameWithType>) is not allowed.
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Offset%28System.Windows.Rect%2CSystem.Double%2CSystem.Double%29> method to change the position of a rectangle.
[!code-csharp[RectExamples_snip#OffsetExample4_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#offsetexample4_csharp)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<paramref name="rect" /> is <see cref="P:System.Windows.Rect.Empty" />.</exception>
</Docs>
</Member>
<Member MemberName="op_Equality">
<MemberSignature Language="C#" Value="public static bool operator == (System.Windows.Rect rect1, System.Windows.Rect rect2);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname bool op_Equality(valuetype System.Windows.Rect rect1, valuetype System.Windows.Rect rect2) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.op_Equality(System.Windows.Rect,System.Windows.Rect)" />
<MemberSignature Language="VB.NET" Value="Public Shared Operator == (rect1 As Rect, rect2 As Rect) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static bool operator ==(System::Windows::Rect rect1, System::Windows::Rect rect2);" />
<MemberSignature Language="F#" Value="static member ( = ) : System.Windows.Rect * System.Windows.Rect -&gt; bool" Usage="rect1 = rect2" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rect1" Type="System.Windows.Rect" />
<Parameter Name="rect2" Type="System.Windows.Rect" />
</Parameters>
<Docs>
<param name="rect1">The first rectangle to compare.</param>
<param name="rect2">The second rectangle to compare.</param>
<summary>Compares two rectangles for exact equality.</summary>
<returns>
<see langword="true" /> if the rectangles have the same <see cref="P:System.Windows.Rect.Location" /> and <see cref="P:System.Windows.Rect.Size" /> values; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This operation tests for object equality.
In this comparison, two instances of <xref:System.Double.NaN?displayProperty=nameWithType> are considered equal.
> [!NOTE]
> A rectangle's position and dimensions are described by <xref:System.Double> values. Because <xref:System.Double> values can lose precision when operated upon, a comparison between two values that are logically equal might fail.
The equivalent method for this operator is <xref:System.Windows.Rect.Equals%28System.Windows.Rect%2CSystem.Windows.Rect%29?displayProperty=nameWithType>
## Examples
The following example shows how to use the <xref:System.Windows.Rect.op_Equality%2A> operator to determine if two rectangles are exactly equal.
[!code-csharp[RectExamples_snip#OverloadedEqualityOperatorExample](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#overloadedequalityoperatorexample)]
[!code-vb[RectExamples_snip#OverloadedEqualityOperatorExample](~/samples/snippets/visualbasic/VS_Snippets_Wpf/RectExamples_snip/visualbasic/rectexample.vb#overloadedequalityoperatorexample)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="op_Inequality">
<MemberSignature Language="C#" Value="public static bool operator != (System.Windows.Rect rect1, System.Windows.Rect rect2);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname bool op_Inequality(valuetype System.Windows.Rect rect1, valuetype System.Windows.Rect rect2) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.op_Inequality(System.Windows.Rect,System.Windows.Rect)" />
<MemberSignature Language="VB.NET" Value="Public Shared Operator != (rect1 As Rect, rect2 As Rect) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static bool operator !=(System::Windows::Rect rect1, System::Windows::Rect rect2);" />
<MemberSignature Language="F#" Value="static member op_Inequality : System.Windows.Rect * System.Windows.Rect -&gt; bool" Usage="System.Windows.Rect.op_Inequality (rect1, rect2)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rect1" Type="System.Windows.Rect" />
<Parameter Name="rect2" Type="System.Windows.Rect" />
</Parameters>
<Docs>
<param name="rect1">The first rectangle to compare.</param>
<param name="rect2">The second rectangle to compare.</param>
<summary>Compares two rectangles for inequality.</summary>
<returns>
<see langword="true" /> if the rectangles do not have the same <see cref="P:System.Windows.Rect.Location" /> and <see cref="P:System.Windows.Rect.Size" /> values; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This operation tests for object inequality.
In this comparison, two instances of <xref:System.Double.NaN?displayProperty=nameWithType> are considered equal.
> [!NOTE]
> A rectangle's position and dimensions are described by <xref:System.Double> values. Because <xref:System.Double> values can lose precision when operated upon, a comparison between two values that are logically equal might fail.
The equivalent method for this operator is <xref:System.Windows.Rect.Equals%28System.Windows.Rect%2CSystem.Windows.Rect%29?displayProperty=nameWithType>
## Examples
The following example shows how to use the <xref:System.Windows.Rect.op_Inequality%2A> operator to determine if two rectangles are not exactly equal.
[!code-csharp[RectExamples_snip#OverloadedInequalityOperatorExample](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#overloadedinequalityoperatorexample)]
[!code-vb[RectExamples_snip#OverloadedInequalityOperatorExample](~/samples/snippets/visualbasic/VS_Snippets_Wpf/RectExamples_snip/visualbasic/rectexample.vb#overloadedinequalityoperatorexample)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Parse">
<MemberSignature Language="C#" Value="public static System.Windows.Rect Parse (string source);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Windows.Rect Parse(string source) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Parse(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Parse (source As String) As Rect" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Windows::Rect Parse(System::String ^ source);" />
<MemberSignature Language="F#" Value="static member Parse : string -&gt; System.Windows.Rect" Usage="System.Windows.Rect.Parse source" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Rect</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.String" />
</Parameters>
<Docs>
<param name="source">The string representation of the rectangle, in the form "x, y, width, height".</param>
<summary>Creates a new rectangle from the specified string representation.</summary>
<returns>The resulting rectangle.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Parse%2A> method to convert a string representation of a rectangle into a <xref:System.Windows.Rect> structure.
[!code-csharp[RectExamples_snip#ParseExample](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#parseexample)]
[!code-vb[RectExamples_snip#ParseExample](~/samples/snippets/visualbasic/VS_Snippets_Wpf/RectExamples_snip/visualbasic/rectexample.vb#parseexample)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Right">
<MemberSignature Language="C#" Value="public double Right { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance float64 Right" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.Right" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Right As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property double Right { double get(); };" />
<MemberSignature Language="F#" Value="member this.Right : double" Usage="System.Windows.Rect.Right" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the x-axis value of the right side of the rectangle.</summary>
<value>The x-axis value of the right side of the rectangle.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The x-axis value of the right side of the rectangle is equal to the sum of the <xref:System.Windows.Rect.X%2A> and <xref:System.Windows.Rect.Width%2A> properties.
## Examples
The following example shows how to use code to create a rectangle and add it to the page. The example also illustrates how to find size and coordinate information about the new rectangle and render the information in a <xref:System.Windows.Controls.TextBox> below the rectangle.
[!code-csharp[RectExamples_snip#CreateRectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample1_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Scale">
<MemberSignature Language="C#" Value="public void Scale (double scaleX, double scaleY);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Scale(float64 scaleX, float64 scaleY) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Scale(System.Double,System.Double)" />
<MemberSignature Language="VB.NET" Value="Public Sub Scale (scaleX As Double, scaleY As Double)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Scale(double scaleX, double scaleY);" />
<MemberSignature Language="F#" Value="member this.Scale : double * double -&gt; unit" Usage="rect.Scale (scaleX, scaleY)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="scaleX" Type="System.Double" />
<Parameter Name="scaleY" Type="System.Double" />
</Parameters>
<Docs>
<param name="scaleX">The scale factor in the x-direction.</param>
<param name="scaleY">The scale factor in the y-direction.</param>
<summary>Multiplies the size of the current rectangle by the specified x and y values.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Scale%2A> method to multiply the width and height of a rectangle by the specified amount.
[!code-csharp[RectExamples_snip#ScaleExample_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#scaleexample_csharp)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Rect.Inflate(System.Double,System.Double)" />
</Docs>
</Member>
<Member MemberName="Size">
<MemberSignature Language="C#" Value="public System.Windows.Size Size { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Size Size" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.Size" />
<MemberSignature Language="VB.NET" Value="Public Property Size As Size" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Size Size { System::Windows::Size get(); void set(System::Windows::Size value); };" />
<MemberSignature Language="F#" Value="member this.Size : System.Windows.Size with get, set" Usage="System.Windows.Rect.Size" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Size</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the width and height of the rectangle.</summary>
<value>A <see cref="T:System.Windows.Size" /> structure that specifies the width and height of the rectangle.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use a <xref:System.Windows.Rect> structure to specify the dimensions and location of a rectangle using XAML.
[!code-csharp[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/CSharp/RectExample.cs#rectexamplewholepage)]
[!code-vb[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/visualbasic/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/visualbasic/rectexample.vb#rectexamplewholepage)]
[!code-xaml[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/xaml/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/XAML/RectExample.xaml#rectexamplewholepage)]
The following example shows how to use code to create a rectangle and add it to the page. The example also illustrates how to find size and coordinate information about the new rectangle and render the information in a <xref:System.Windows.Controls.TextBox> below the rectangle.
[!code-csharp[RectExamples_snip#CreateRectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample1_csharp)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<see cref="P:System.Windows.Rect.Size" /> is set on an <see cref="P:System.Windows.Rect.Empty" /> rectangle.</exception>
</Docs>
</Member>
<Member MemberName="System.IFormattable.ToString">
<MemberSignature Language="C#" Value="string IFormattable.ToString (string format, IFormatProvider provider);" />
<MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance string System.IFormattable.ToString(string format, class System.IFormatProvider provider) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.System#IFormattable#ToString(System.String,System.IFormatProvider)" />
<MemberSignature Language="VB.NET" Value="Function ToString (format As String, provider As IFormatProvider) As String Implements IFormattable.ToString" />
<MemberSignature Language="C++ CLI" Value=" virtual System::String ^ System.IFormattable.ToString(System::String ^ format, IFormatProvider ^ provider) = IFormattable::ToString;" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IFormattable.ToString(System.String,System.IFormatProvider)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="format" Type="System.String" />
<Parameter Name="provider" Type="System.IFormatProvider" />
</Parameters>
<Docs>
<param name="format">The format to use.
-or-
A null reference (<see langword="Nothing" /> in Visual Basic) to use the default format defined for the type of the <see cref="T:System.IFormattable" /> implementation.</param>
<param name="provider">The provider to use to format the value.
-or-
A null reference (<see langword="Nothing" /> in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.</param>
<summary>Formats the value of the current instance using the specified format.</summary>
<returns>A string representation of the rectangle.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This member is an explicit interface member implementation. It can be used only when the <xref:System.Windows.Rect> instance is cast to an <xref:System.IFormattable> interface.
]]></format>
</remarks>
<altmember cref="T:System.IFormattable" />
</Docs>
</Member>
<Member MemberName="Top">
<MemberSignature Language="C#" Value="public double Top { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance float64 Top" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.Top" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Top As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property double Top { double get(); };" />
<MemberSignature Language="F#" Value="member this.Top : double" Usage="System.Windows.Rect.Top" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the y-axis position of the top of the rectangle.</summary>
<value>The y-axis position of the top of the rectangle.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Getting this property is equivalent to getting the <xref:System.Windows.Rect.Y%2A> property.
## Examples
The following example shows how to use code to create a rectangle and add it to the page. The example also illustrates how to find size and coordinate information about the new rectangle and render the information in a <xref:System.Windows.Controls.TextBox> below the rectangle.
[!code-csharp[RectExamples_snip#CreateRectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample1_csharp)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Rect.Y" />
</Docs>
</Member>
<Member MemberName="TopLeft">
<MemberSignature Language="C#" Value="public System.Windows.Point TopLeft { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Point TopLeft" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.TopLeft" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property TopLeft As Point" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Point TopLeft { System::Windows::Point get(); };" />
<MemberSignature Language="F#" Value="member this.TopLeft : System.Windows.Point" Usage="System.Windows.Rect.TopLeft" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Point</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the position of the top-left corner of the rectangle.</summary>
<value>The position of the top-left corner of the rectangle.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The position of the top-left corner of the rectangle is equal to (<xref:System.Windows.Rect.X%2A>, <xref:System.Windows.Rect.Y%2A>).
## Examples
The following example shows how to use code to create a rectangle and add it to the page. The example also illustrates how to find size and coordinate information about the new rectangle and render the information in a <xref:System.Windows.Controls.TextBox> below the rectangle.
[!code-csharp[RectExamples_snip#CreateRectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample1_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="TopRight">
<MemberSignature Language="C#" Value="public System.Windows.Point TopRight { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Point TopRight" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.TopRight" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property TopRight As Point" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Point TopRight { System::Windows::Point get(); };" />
<MemberSignature Language="F#" Value="member this.TopRight : System.Windows.Point" Usage="System.Windows.Rect.TopRight" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Point</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the position of the top-right corner of the rectangle.</summary>
<value>The position of the top-right corner of the rectangle.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The position of the top-right corner of the rectangle is equal to (<xref:System.Windows.Rect.X%2A> + <xref:System.Windows.Rect.Width%2A>, <xref:System.Windows.Rect.Y%2A>).
## Examples
The following example shows how to use code to create a rectangle and add it to the page. The example also illustrates how to find size and coordinate information about the new rectangle and render the information in a <xref:System.Windows.Controls.TextBox> below the rectangle.
[!code-csharp[RectExamples_snip#CreateRectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample1_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="ToString">
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Returns a string representation of the rectangle.</summary>
</Docs>
</MemberGroup>
<Member MemberName="ToString">
<MemberSignature Language="C#" Value="public override string ToString ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string ToString() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.ToString" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function ToString () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::String ^ ToString();" />
<MemberSignature Language="F#" Value="override this.ToString : unit -&gt; string" Usage="rect.ToString " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns a string representation of the rectangle.</summary>
<returns>A string representation of the current rectangle. The string has the following form: "<see cref="P:System.Windows.Rect.X" />,<see cref="P:System.Windows.Rect.Y" />,<see cref="P:System.Windows.Rect.Width" />,<see cref="P:System.Windows.Rect.Height" />".</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use the <xref:System.Windows.Rect.ToString> method to get a string representation of a <xref:System.Windows.Rect> structure.
[!code-csharp[RectExamples_snip#ToStringExample_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#tostringexample_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ToString">
<MemberSignature Language="C#" Value="public string ToString (IFormatProvider provider);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance string ToString(class System.IFormatProvider provider) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.ToString(System.IFormatProvider)" />
<MemberSignature Language="VB.NET" Value="Public Function ToString (provider As IFormatProvider) As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::String ^ ToString(IFormatProvider ^ provider);" />
<MemberSignature Language="F#" Value="override this.ToString : IFormatProvider -&gt; string" Usage="rect.ToString provider" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="provider" Type="System.IFormatProvider" />
</Parameters>
<Docs>
<param name="provider">Culture-specific formatting information.</param>
<summary>Returns a string representation of the rectangle by using the specified format provider.</summary>
<returns>A string representation of the current rectangle that is determined by the specified format provider.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<MemberGroup MemberName="Transform">
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Transforms a rectangle by using the specified matrix.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Transform">
<MemberSignature Language="C#" Value="public void Transform (System.Windows.Media.Matrix matrix);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Transform(valuetype System.Windows.Media.Matrix matrix) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Transform(System.Windows.Media.Matrix)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Transform(System::Windows::Media::Matrix matrix);" />
<MemberSignature Language="F#" Value="member this.Transform : System.Windows.Media.Matrix -&gt; unit" Usage="rect.Transform matrix" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="matrix" Type="System.Windows.Media.Matrix" />
</Parameters>
<Docs>
<param name="matrix">A matrix that specifies the transformation to apply.</param>
<summary>Transforms the rectangle by applying the specified matrix.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Transform%28System.Windows.Media.Matrix%29> method to transform a <xref:System.Windows.Rect> structure by using a <xref:System.Windows.Media.Matrix>.
[!code-csharp[RectExamples_snip#TransformExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#transformexample1_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Transform">
<MemberSignature Language="C#" Value="public static System.Windows.Rect Transform (System.Windows.Rect rect, System.Windows.Media.Matrix matrix);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Windows.Rect Transform(valuetype System.Windows.Rect rect, valuetype System.Windows.Media.Matrix matrix) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Transform(System.Windows.Rect,System.Windows.Media.Matrix)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Windows::Rect Transform(System::Windows::Rect rect, System::Windows::Media::Matrix matrix);" />
<MemberSignature Language="F#" Value="static member Transform : System.Windows.Rect * System.Windows.Media.Matrix -&gt; System.Windows.Rect" Usage="System.Windows.Rect.Transform (rect, matrix)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Rect</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rect" Type="System.Windows.Rect" />
<Parameter Name="matrix" Type="System.Windows.Media.Matrix" />
</Parameters>
<Docs>
<param name="rect">A rectangle that is the basis for the transformation.</param>
<param name="matrix">A matrix that specifies the transformation to apply.</param>
<summary>Returns the rectangle that results from applying the specified matrix to the specified rectangle.</summary>
<returns>The rectangle that results from the operation.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Transform%28System.Windows.Rect%2CSystem.Windows.Media.Matrix%29> method to create a new <xref:System.Windows.Rect> structure that results from applying a <xref:System.Windows.Media.Matrix> to an existing rectangle.
[!code-csharp[RectExamples_snip#TransformExample2_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#transformexample2_csharp)]
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="Union">
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Creates a rectangle that is exactly large enough to contain a given rectangle and a specified point or second rectangle.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Union">
<MemberSignature Language="C#" Value="public void Union (System.Windows.Point point);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Union(valuetype System.Windows.Point point) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Union(System.Windows.Point)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Union(System::Windows::Point point);" />
<MemberSignature Language="F#" Value="member this.Union : System.Windows.Point -&gt; unit" Usage="rect.Union point" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="point" Type="System.Windows.Point" />
</Parameters>
<Docs>
<param name="point">The point to include.</param>
<summary>Expands the current rectangle exactly enough to contain the specified point.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Union%28System.Windows.Point%29> method to expand the current rectangle exactly enough to contain a given <xref:System.Windows.Point>.
[!code-csharp[RectExamples_snip#UnionExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#unionexample1_csharp)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Rect.Contains(System.Windows.Point)" />
</Docs>
</Member>
<Member MemberName="Union">
<MemberSignature Language="C#" Value="public void Union (System.Windows.Rect rect);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Union(valuetype System.Windows.Rect rect) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Union(System.Windows.Rect)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Union(System::Windows::Rect rect);" />
<MemberSignature Language="F#" Value="member this.Union : System.Windows.Rect -&gt; unit" Usage="rect.Union rect" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rect" Type="System.Windows.Rect" />
</Parameters>
<Docs>
<param name="rect">The rectangle to include.</param>
<summary>Expands the current rectangle exactly enough to contain the specified rectangle.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Union%28System.Windows.Rect%29> method to expand the current rectangle exactly enough to contain the specified rectangle.
[!code-csharp[RectExamples_snip#UnionExample2_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#unionexample2_csharp)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Rect.Contains(System.Windows.Rect)" />
</Docs>
</Member>
<Member MemberName="Union">
<MemberSignature Language="C#" Value="public static System.Windows.Rect Union (System.Windows.Rect rect, System.Windows.Point point);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Windows.Rect Union(valuetype System.Windows.Rect rect, valuetype System.Windows.Point point) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Union(System.Windows.Rect,System.Windows.Point)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Windows::Rect Union(System::Windows::Rect rect, System::Windows::Point point);" />
<MemberSignature Language="F#" Value="static member Union : System.Windows.Rect * System.Windows.Point -&gt; System.Windows.Rect" Usage="System.Windows.Rect.Union (rect, point)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Rect</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rect" Type="System.Windows.Rect" />
<Parameter Name="point" Type="System.Windows.Point" />
</Parameters>
<Docs>
<param name="rect">The rectangle to include.</param>
<param name="point">The point to include.</param>
<summary>Creates a rectangle that is exactly large enough to include the specified rectangle and the specified point.</summary>
<returns>A rectangle that is exactly large enough to contain the specified rectangle and the specified point.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Union%28System.Windows.Rect%2CSystem.Windows.Point%29> method to create a rectangle that is exactly large enough to contain a given rectangle and a given <xref:System.Windows.Point>.
[!code-csharp[RectExamples_snip#UnionExample3_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#unionexample3_csharp)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Rect.Contains(System.Windows.Point)" />
</Docs>
</Member>
<Member MemberName="Union">
<MemberSignature Language="C#" Value="public static System.Windows.Rect Union (System.Windows.Rect rect1, System.Windows.Rect rect2);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Windows.Rect Union(valuetype System.Windows.Rect rect1, valuetype System.Windows.Rect rect2) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Rect.Union(System.Windows.Rect,System.Windows.Rect)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Union (rect1 As Rect, rect2 As Rect) As Rect" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Windows::Rect Union(System::Windows::Rect rect1, System::Windows::Rect rect2);" />
<MemberSignature Language="F#" Value="static member Union : System.Windows.Rect * System.Windows.Rect -&gt; System.Windows.Rect" Usage="System.Windows.Rect.Union (rect1, rect2)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Rect</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rect1" Type="System.Windows.Rect" />
<Parameter Name="rect2" Type="System.Windows.Rect" />
</Parameters>
<Docs>
<param name="rect1">The first rectangle to include.</param>
<param name="rect2">The second rectangle to include.</param>
<summary>Creates a rectangle that is exactly large enough to contain the two specified rectangles.</summary>
<returns>The resulting rectangle.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example shows how to use the <xref:System.Windows.Rect.Union%28System.Windows.Rect%2CSystem.Windows.Rect%29> method to create a rectangle that is exactly large enough to contain two given rectangles.
[!code-csharp[RectExamples_snip#UnionExample4_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#unionexample4_csharp)]
]]></format>
</remarks>
<altmember cref="M:System.Windows.Rect.Contains(System.Windows.Rect)" />
</Docs>
</Member>
<Member MemberName="Width">
<MemberSignature Language="C#" Value="public double Width { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance float64 Width" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.Width" />
<MemberSignature Language="VB.NET" Value="Public Property Width As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property double Width { double get(); void set(double value); };" />
<MemberSignature Language="F#" Value="member this.Width : double with get, set" Usage="System.Windows.Rect.Width" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the width of the rectangle.</summary>
<value>A positive number that represents the width of the rectangle. The default is 0.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Rect.Empty%2A> rectangle has a <xref:System.Windows.Rect.Width%2A> of <xref:System.Double.NegativeInfinity>. The <xref:System.Windows.Rect.Empty%2A> rectangle is read-only; its <xref:System.Windows.Rect.Width%2A> cannot not be changed.
## Examples
The following example shows how to use a <xref:System.Windows.Rect> structure to specify the dimensions and location of a rectangle using XAML.
[!code-csharp[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/CSharp/RectExample.cs#rectexamplewholepage)]
[!code-vb[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/visualbasic/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/visualbasic/rectexample.vb#rectexamplewholepage)]
[!code-xaml[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/xaml/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/XAML/RectExample.xaml#rectexamplewholepage)]
The following example shows how to use code to create a rectangle and add it to the page. The example also illustrates how to find size and coordinate information about the new rectangle and render the information in a <xref:System.Windows.Controls.TextBox> below the rectangle.
[!code-csharp[RectExamples_snip#CreateRectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample1_csharp)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<see cref="P:System.Windows.Rect.Width" /> is set to a negative value.</exception>
<exception cref="T:System.InvalidOperationException">
<see cref="P:System.Windows.Rect.Width" /> is set on an <see cref="P:System.Windows.Rect.Empty" /> rectangle.</exception>
<altmember cref="P:System.Windows.Rect.Height" />
</Docs>
</Member>
<Member MemberName="X">
<MemberSignature Language="C#" Value="public double X { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance float64 X" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.X" />
<MemberSignature Language="VB.NET" Value="Public Property X As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property double X { double get(); void set(double value); };" />
<MemberSignature Language="F#" Value="member this.X : double with get, set" Usage="System.Windows.Rect.X" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the x-axis value of the left side of the rectangle.</summary>
<value>The x-axis value of the left side of the rectangle.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Getting this property is equivalent to getting the <xref:System.Windows.Rect.Left%2A> property.
## Examples
The following example shows how to use a <xref:System.Windows.Rect> structure to specify the dimensions and location of a rectangle using XAML.
[!code-csharp[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/CSharp/RectExample.cs#rectexamplewholepage)]
[!code-vb[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/visualbasic/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/visualbasic/rectexample.vb#rectexamplewholepage)]
[!code-xaml[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/xaml/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/XAML/RectExample.xaml#rectexamplewholepage)]
The following example shows how to use code to create a rectangle and add it to the page. The example also illustrates how to find size and coordinate information about the new rectangle and render the information in a <xref:System.Windows.Controls.TextBox> below the rectangle.
[!code-csharp[RectExamples_snip#CreateRectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample1_csharp)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<see cref="P:System.Windows.Rect.X" /> is set on an <see cref="P:System.Windows.Rect.Empty" /> rectangle.</exception>
<altmember cref="P:System.Windows.Rect.Y" />
</Docs>
</Member>
<Member MemberName="Y">
<MemberSignature Language="C#" Value="public double Y { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance float64 Y" />
<MemberSignature Language="DocId" Value="P:System.Windows.Rect.Y" />
<MemberSignature Language="VB.NET" Value="Public Property Y As Double" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property double Y { double get(); void set(double value); };" />
<MemberSignature Language="F#" Value="member this.Y : double with get, set" Usage="System.Windows.Rect.Y" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the y-axis value of the top side of the rectangle.</summary>
<value>The y-axis value of the top side of the rectangle.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Getting this property is equivalent to getting the <xref:System.Windows.Rect.Top%2A> property.
## Examples
The following example shows how to use a <xref:System.Windows.Rect> structure to specify the dimensions and location of a rectangle using XAML.
[!code-csharp[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/CSharp/RectExample.cs#rectexamplewholepage)]
[!code-vb[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/visualbasic/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/visualbasic/rectexample.vb#rectexamplewholepage)]
[!code-xaml[GeometriesMiscSnippets_snip#RectExampleWholePage](~/samples/snippets/xaml/VS_Snippets_Wpf/GeometriesMiscSnippets_snip/XAML/RectExample.xaml#rectexamplewholepage)]
The following example shows how to use code to create a rectangle and add it to the page. The example also illustrates how to find size and coordinate information about the new rectangle and render the information in a <xref:System.Windows.Controls.TextBox> below the rectangle.
[!code-csharp[RectExamples_snip#CreateRectExample1_csharp](~/samples/snippets/csharp/VS_Snippets_Wpf/RectExamples_snip/CSharp/RectExample.cs#createrectexample1_csharp)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<see cref="P:System.Windows.Rect.Y" /> is set on an <see cref="P:System.Windows.Rect.Empty" /> rectangle.</exception>
<altmember cref="P:System.Windows.Rect.X" />
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.