.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,454 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have an poup that is opening with an animation
private async void PopUpBorder_Loaded(object sender, EventArgs e) {
PopUpBorder.Scale = 0.5;
PopUpBorder.Opacity = 0;
await Task.WhenAll(new Task[]
{
PopUpBorder.ScaleTo(1, 500, Easing.CubicInOut),
PopUpBorder.FadeTo(1, 500, Easing.CubicInOut)
});
}
https://reccloud.com/u/1o1r2a1
but when I close it, it closes from the upper left, and I want to close it from the center
like the way I open it
private static async Task ExiitAnimation(Popup popup) {
if (popup.Content is VisualElement popUpBorder) {
// Set the anchor to the center
popUpBorder.AnchorX = 0.5;
popUpBorder.AnchorY = 0.5;
await Task.WhenAll(new Task[]
{
popUpBorder.ScaleTo(0.5, 500, Easing.CubicInOut),
popUpBorder.FadeTo(0, 500, Easing.CubicInOut)
});
popup.Close();
}