Browse Source

Add back PlacementMode properties as obsolete aliases of Placement

pull/10664/head
robloo 4 years ago
parent
commit
2b33704989
  1. 18
      src/Avalonia.Controls/ContextMenu.cs
  2. 14
      src/Avalonia.Controls/Primitives/Popup.cs

18
src/Avalonia.Controls/ContextMenu.cs

@ -54,12 +54,22 @@ namespace Avalonia.Controls
public static readonly StyledProperty<PopupGravity> PlacementGravityProperty =
Popup.PlacementGravityProperty.AddOwner<ContextMenu>();
/// <summary>
/// Defines the <see cref="PlacementMode"/> property.
/// </summary>
[Obsolete("Use the Placement property instead.")]
public static readonly StyledProperty<PlacementMode> PlacementModeProperty = PlacementProperty;
#pragma warning disable AVP1013 // AvaloniaProperty owners should not be added superfluously
/// <summary>
/// Defines the <see cref="Placement"/> property.
/// </summary>
public static readonly StyledProperty<PlacementMode> PlacementProperty =
Popup.PlacementProperty.AddOwner<ContextMenu>();
#pragma warning restore AVP1013 // AvaloniaProperty owners should not be added superfluously
/// <summary>
/// Defines the <see cref="PlacementRect"/> property.
/// </summary>
@ -149,6 +159,14 @@ namespace Avalonia.Controls
set => SetValue(PlacementGravityProperty, value);
}
/// <inheritdoc cref="Placement"/>
[Obsolete("Use the Placement property instead.")]
public PlacementMode PlacementMode
{
get => GetValue(PlacementProperty);
set => SetValue(PlacementProperty, value);
}
/// <inheritdoc cref="Popup.Placement"/>
public PlacementMode Placement
{

14
src/Avalonia.Controls/Primitives/Popup.cs

@ -65,6 +65,12 @@ namespace Avalonia.Controls.Primitives
public static readonly StyledProperty<PopupGravity> PlacementGravityProperty =
AvaloniaProperty.Register<Popup, PopupGravity>(nameof(PlacementGravity));
/// <summary>
/// Defines the <see cref="PlacementMode"/> property.
/// </summary>
[Obsolete("Use the Placement property instead.")]
public static readonly StyledProperty<PlacementMode> PlacementModeProperty = PlacementProperty;
/// <summary>
/// Defines the <see cref="Placement"/> property.
/// </summary>
@ -234,6 +240,14 @@ namespace Avalonia.Controls.Primitives
set => SetValue(PlacementGravityProperty, value);
}
/// <inheritdoc cref="Placement"/>
[Obsolete("Use the Placement property instead.")]
public PlacementMode PlacementMode
{
get => GetValue(PlacementProperty);
set => SetValue(PlacementProperty, value);
}
/// <summary>
/// Gets or sets the desired placement of the popup in relation to the <see cref="PlacementTarget"/>.
/// </summary>

Loading…
Cancel
Save