feat: WIP.

This commit is contained in:
rabbitism
2024-02-05 01:18:08 +08:00
parent 5b8763bc4a
commit 2ac5dfa170
4 changed files with 4 additions and 4 deletions

View File

@@ -28,7 +28,6 @@ public partial class OverlayDialogHost
control.Arrange(new Rect(control.DesiredSize));
control.Height = this.Bounds.Height;
control.AddHandler(OverlayFeedbackElement.ClosedEvent, OnDrawerControlClosing);
// SetLeft(control, this.Bounds.Width - control.Bounds.Width);
var animation = CreateAnimation(control.Bounds.Width);
var animation2 = CreateOpacityAnimation();
await Task.WhenAll(animation.RunAsync(control), animation2.RunAsync(mask));

View File

@@ -20,6 +20,7 @@ public partial class OverlayDialogHost: Canvas
static OverlayDialogHost()
{
ClipToBoundsProperty.OverrideDefaultValue<OverlayDialogHost>(true);
_maskAppearAnimation = CreateOpacityAnimation(true);
_maskDisappearAnimation = CreateOpacityAnimation(false);
}
@@ -34,7 +35,7 @@ public partial class OverlayDialogHost: Canvas
keyFrame2.Setters.Add(new Setter() { Property = OpacityProperty, Value = appear ? 1.0 : 0.0 });
animation.Children.Add(keyFrame1);
animation.Children.Add(keyFrame2);
animation.Duration = TimeSpan.FromSeconds(0.3);
animation.Duration = TimeSpan.FromSeconds(0.2);
return animation;
}
@@ -75,9 +76,9 @@ public partial class OverlayDialogHost: Canvas
if (sender is Border border)
{
int i = _masks.IndexOf(border);
if (_modalDialogs[i] is { } dialog)
if (_modalDialogs[i] is { } element)
{
dialog.Close();
element.Close();
border.RemoveHandler(PointerReleasedEvent, ClickBorderToCloseDialog);
}
}