feat: add IsTopLevel property to OverlayDialogHost. only marked Host can trigger window movement.

This commit is contained in:
rabbitism
2024-09-12 15:41:12 +08:00
parent 95f28e14f4
commit a81fe88eb6
3 changed files with 4 additions and 3 deletions

View File

@@ -72,7 +72,7 @@ public partial class OverlayDialogHost
{
if (e.Source is DialogControlBase item)
{
if (item.IsFullScreen)
if (IsTopLevel && item.IsFullScreen)
{
var top = TopLevel.GetTopLevel(item);
if (top is Window w)

View File

@@ -56,6 +56,7 @@ public partial class OverlayDialogHost: Canvas
}
public bool IsAnimationDisabled { get; set; }
public bool IsTopLevel { get; set; }
static OverlayDialogHost()
{
@@ -114,7 +115,7 @@ public partial class OverlayDialogHost: Canvas
{
rec.AddHandler(PointerReleasedEvent, ClickMaskToCloseDialog);
}
else
else if(IsTopLevel)
{
rec.AddHandler(PointerPressedEvent, DragMaskToMoveWindow);
}