Browse Source

Inherit some ContextMenu property docs from Popup

pull/10664/head
robloo 4 years ago
parent
commit
6f523e1414
  1. 43
      src/Avalonia.Controls/ContextMenu.cs

43
src/Avalonia.Controls/ContextMenu.cs

@ -114,57 +114,42 @@ namespace Avalonia.Controls
AutomationProperties.ControlTypeOverrideProperty.OverrideDefaultValue<ContextMenu>(AutomationControlType.Menu); AutomationProperties.ControlTypeOverrideProperty.OverrideDefaultValue<ContextMenu>(AutomationControlType.Menu);
} }
/// <summary> /// <inheritdoc cref="Popup.HorizontalOffset"/>
/// Gets or sets the Horizontal offset of the context menu in relation to the <see cref="PlacementTarget"/>.
/// </summary>
public double HorizontalOffset public double HorizontalOffset
{ {
get => GetValue(HorizontalOffsetProperty); get => GetValue(HorizontalOffsetProperty);
set => SetValue(HorizontalOffsetProperty, value); set => SetValue(HorizontalOffsetProperty, value);
} }
/// <summary> /// <inheritdoc cref="Popup.VerticalOffset"/>
/// Gets or sets the Vertical offset of the context menu in relation to the <see cref="PlacementTarget"/>.
/// </summary>
public double VerticalOffset public double VerticalOffset
{ {
get => GetValue(VerticalOffsetProperty); get => GetValue(VerticalOffsetProperty);
set => SetValue(VerticalOffsetProperty, value); set => SetValue(VerticalOffsetProperty, value);
} }
/// <summary> /// <inheritdoc cref="Popup.PlacementAnchor"/>
/// Gets or sets the anchor point on the <see cref="PlacementRect"/> when <see cref="Placement"/>
/// is <see cref="PlacementMode.AnchorAndGravity"/>.
/// </summary>
public PopupAnchor PlacementAnchor public PopupAnchor PlacementAnchor
{ {
get => GetValue(PlacementAnchorProperty); get => GetValue(PlacementAnchorProperty);
set => SetValue(PlacementAnchorProperty, value); set => SetValue(PlacementAnchorProperty, value);
} }
/// <summary> /// <inheritdoc cref="Popup.PlacementConstraintAdjustment"/>
/// Gets or sets a value describing how the context menu position will be adjusted if the
/// unadjusted position would result in the context menu being partly constrained.
/// </summary>
public PopupPositionerConstraintAdjustment PlacementConstraintAdjustment public PopupPositionerConstraintAdjustment PlacementConstraintAdjustment
{ {
get => GetValue(PlacementConstraintAdjustmentProperty); get => GetValue(PlacementConstraintAdjustmentProperty);
set => SetValue(PlacementConstraintAdjustmentProperty, value); set => SetValue(PlacementConstraintAdjustmentProperty, value);
} }
/// <summary> /// <inheritdoc cref="Popup.PlacementGravity"/>
/// Gets or sets a value which defines in what direction the context menu should open
/// when <see cref="Placement"/> is <see cref="PlacementMode.AnchorAndGravity"/>.
/// </summary>
public PopupGravity PlacementGravity public PopupGravity PlacementGravity
{ {
get => GetValue(PlacementGravityProperty); get => GetValue(PlacementGravityProperty);
set => SetValue(PlacementGravityProperty, value); set => SetValue(PlacementGravityProperty, value);
} }
/// <summary> /// <inheritdoc cref="Popup.Placement"/>
/// Gets or sets the desired placement of the context menu in relation to the<see cref="PlacementTarget"/>.
/// </summary>
public PlacementMode Placement public PlacementMode Placement
{ {
get => GetValue(PlacementProperty); get => GetValue(PlacementProperty);
@ -177,26 +162,14 @@ namespace Avalonia.Controls
set => SetValue(WindowManagerAddShadowHintProperty, value); set => SetValue(WindowManagerAddShadowHintProperty, value);
} }
/// <summary> /// <inheritdoc cref="Popup.PlacementRect"/>
/// Gets or sets the the anchor rectangle within the parent that the context menu will be placed
/// relative to when <see cref="Placement"/> is <see cref="PlacementMode.AnchorAndGravity"/>.
/// </summary>
/// <remarks>
/// The placement rect defines a rectangle relative to <see cref="PlacementTarget"/> around
/// which the popup will be opened, with <see cref="PlacementAnchor"/> determining which edge
/// of the placement target is used.
///
/// If unset, the anchor rectangle will be the bounds of the <see cref="PlacementTarget"/>.
/// </remarks>
public Rect? PlacementRect public Rect? PlacementRect
{ {
get => GetValue(PlacementRectProperty); get => GetValue(PlacementRectProperty);
set => SetValue(PlacementRectProperty, value); set => SetValue(PlacementRectProperty, value);
} }
/// <summary> /// <inheritdoc cref="Popup.PlacementTarget"/>
/// Gets or sets the control that is used to determine the popup's position.
/// </summary>
public Control? PlacementTarget public Control? PlacementTarget
{ {
get => GetValue(PlacementTargetProperty); get => GetValue(PlacementTargetProperty);

Loading…
Cancel
Save