Browse Source

Merge branch 'master' of https://github.com/AvaloniaUI/Avalonia into feature/flowDirectionImpl

pull/7810/head
daniel mayost 5 years ago
parent
commit
f75491bece
  1. 6
      src/Avalonia.Controls/ContextMenu.cs

6
src/Avalonia.Controls/ContextMenu.cs

@ -351,6 +351,11 @@ namespace Avalonia.Controls
? PlacementMode.Bottom
: PlacementMode;
//Position of the line below is really important.
//All styles are being applied only when control has logical parent.
//Line below will add ContextMenu as child to the Popup and this will trigger styles and they would be applied.
//If you will move line below somewhere else it may cause that ContextMenu will behave differently from what you are expecting.
_popup.Child = this;
_popup.PlacementTarget = placementTarget;
_popup.HorizontalOffset = HorizontalOffset;
_popup.VerticalOffset = VerticalOffset;
@ -359,7 +364,6 @@ namespace Avalonia.Controls
_popup.PlacementGravity = PlacementGravity;
_popup.PlacementRect = PlacementRect;
_popup.WindowManagerAddShadowHint = WindowManagerAddShadowHint;
_popup.Child = this;
IsOpen = true;
_popup.IsOpen = true;

Loading…
Cancel
Save