Skip to content

Commit

Permalink
Merge pull request #5822 from AvaloniaUI/fixes/do-not-obsolete-contex…
Browse files Browse the repository at this point in the history
…t-menu-api

dont obsolete context menu apis.
  • Loading branch information
grokys committed Apr 21, 2021
2 parents 222860c + ab1bf41 commit 9794354
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/Avalonia.Controls/Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public class Control : InputElement, IControl, INamed, IVisualBrushInitialize, I
/// <summary>
/// Defines the <see cref="ContextMenu"/> property.
/// </summary>
[Obsolete("Prefer ContextFlyout")]
public static readonly StyledProperty<ContextMenu?> ContextMenuProperty =
AvaloniaProperty.Register<Control, ContextMenu?>(nameof(ContextMenu));

Expand Down Expand Up @@ -77,7 +76,6 @@ public class Control : InputElement, IControl, INamed, IVisualBrushInitialize, I
/// <summary>
/// Gets or sets a context menu to the control.
/// </summary>
[Obsolete("Prefer ContextFlyout")]
public ContextMenu? ContextMenu
{
get => GetValue(ContextMenuProperty);
Expand Down
1 change: 0 additions & 1 deletion src/Avalonia.Themes.Default/TextBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<MenuItem x:Name="TextBoxContextFlyoutPasteItem" Header="Paste" Command="{Binding $parent[TextBox].Paste}" IsEnabled="{Binding $parent[TextBox].CanPaste}" InputGesture="{x:Static TextBox.PasteGesture}"/>
</MenuFlyout>

<!-- ContextMenu obsolete, prefer ContextFlyout -->
<ContextMenu x:Key="DefaultTextBoxContextMenu" x:Name="TextBoxContextMenu">
<MenuItem x:Name="TextBoxContextMenuCutItem" Header="Cut" Command="{Binding $parent[TextBox].Cut}" IsEnabled="{Binding $parent[TextBox].CanCut}" InputGesture="{x:Static TextBox.CutGesture}" />
<MenuItem x:Name="TextBoxContextMenuCopyItem" Header="Copy" Command="{Binding $parent[TextBox].Copy}" IsEnabled="{Binding $parent[TextBox].CanCopy}" InputGesture="{x:Static TextBox.CopyGesture}"/>
Expand Down
1 change: 0 additions & 1 deletion src/Avalonia.Themes.Fluent/Controls/TextBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<MenuItem x:Name="TextBoxContextFlyoutPasteItem" Header="Paste" Command="{Binding $parent[TextBox].Paste}" IsEnabled="{Binding $parent[TextBox].CanPaste}" InputGesture="{x:Static TextBox.PasteGesture}"/>
</MenuFlyout>

<!-- ContextMenu obsolete, prefer ContextFlyout -->
<ContextMenu x:Key="DefaultTextBoxContextMenu" x:Name="TextBoxContextMenu">
<MenuItem x:Name="TextBoxContextMenuCutItem" Header="Cut" Command="{Binding $parent[TextBox].Cut}" IsEnabled="{Binding $parent[TextBox].CanCut}" InputGesture="{x:Static TextBox.CutGesture}" />
<MenuItem x:Name="TextBoxContextMenuCopyItem" Header="Copy" Command="{Binding $parent[TextBox].Copy}" IsEnabled="{Binding $parent[TextBox].CanCopy}" InputGesture="{x:Static TextBox.CopyGesture}"/>
Expand Down

0 comments on commit 9794354

Please sign in to comment.