feat: add option to disable animation.

This commit is contained in:
rabbitism
2024-03-27 21:54:44 +08:00
parent 4c1befb7dd
commit 77f4a5e051
3 changed files with 39 additions and 12 deletions

View File

@@ -126,7 +126,10 @@ public partial class OverlayDialogHost
{
_modalCount--;
HasModal = _modalCount > 0;
await _maskDisappearAnimation.RunAsync(layer.Mask);
if (!IsAnimationDisabled)
{
await _maskDisappearAnimation.RunAsync(layer.Mask);
}
}
}
@@ -156,7 +159,10 @@ public partial class OverlayDialogHost
SetToPosition(control);
control.AddHandler(OverlayFeedbackElement.ClosedEvent, OnDialogControlClosing);
control.AddHandler(DialogControlBase.LayerChangedEvent, OnDialogLayerChanged);
_maskAppearAnimation.RunAsync(mask);
if (!IsAnimationDisabled)
{
_maskAppearAnimation.RunAsync(mask);
}
_modalCount++;
HasModal = _modalCount > 0;
control.IsClosed = false;