feat: make sure MessageBox support drag move.

This commit is contained in:
rabbitism
2024-03-10 16:12:32 +08:00
committed by rabbitism
parent 6e897b63fe
commit 0349f6ad95
3 changed files with 4 additions and 4 deletions

View File

@@ -30,7 +30,6 @@ public abstract class DialogControlBase : OverlayFeedbackElement
internal double? HorizontalOffsetRatio { get; set; }
internal double? VerticalOffsetRatio { get; set; }
internal bool CanLightDismiss { get; set; }
internal bool CanDragMove { get; set; }
protected internal Button? _closeButton;
private Panel? _titleArea;
@@ -143,7 +142,7 @@ public abstract class DialogControlBase : OverlayFeedbackElement
{
base.OnApplyTemplate(e);
_titleArea = e.NameScope.Find<Panel>(PART_TitleArea);
if (CanDragMove)
if (GetCanDragMove(this))
{
_titleArea?.RemoveHandler(PointerMovedEvent, OnTitlePointerMove);
_titleArea?.RemoveHandler(PointerPressedEvent, OnTitlePointerPressed);