Edit

Share via


ContextMenu.PlacementRectangle Property

Definition

Gets or sets the area relative to which the context menu is positioned when it opens.

public:
 property System::Windows::Rect PlacementRectangle { System::Windows::Rect get(); void set(System::Windows::Rect value); };
[System.ComponentModel.Bindable(true)]
public System.Windows.Rect PlacementRectangle { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.PlacementRectangle : System.Windows.Rect with get, set
Public Property PlacementRectangle As Rect

Property Value

The area that defines the rectangle that is used to position the context menu. The default is Empty.

Attributes

Examples

The following example shows how to use the PlacementRectangle property and specify where the ContextMenu is placed.

<ContextMenu Placement="Bottom" PlacementRectangle="30,50,0,0">

Remarks

You can position a ContextMenu by setting the PlacementTarget, PlacementRectangle, Placement, HorizontalOffset, and VerticalOffsetProperty properties. These properties behave the same as they do for a Popup. For more information, see Popup Placement Behavior.

Dependency Property Information

Identifier field PlacementRectangleProperty
Metadata properties set to true None

Applies to

See also