Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

RG.PopupPage is calling OnDisappearingAnimationBeginAsync immediately on opening

$
0
0

I have a Xamarin Forms app which is mainly deploying to a UWP project. I have a popup to display a delete confirmation to the user when they start to delete a data element. The dialog is appearing but immediately dismissing. When I run in the debugger I am seeing that the OnAppearingAnimationEndAsync method is called and immediately after that the OnDisappearingAnimationBeginAsync method is called and the dialog dismisses.

The invoking code looks like:
public async Task ConfirmDeleteAsync(Frame cell)
{
RemoveRunContentView entryView = new RemoveRunContentView(TestRunItem);
InputAlertDialogBase deleteConfirmPopup =
new InputAlertDialogBase(entryView)
{
IsAnimationEnabled = false,
CloseWhenBackgroundIsClicked = false
};

                entryView.EnterButtonEventHandler += (sender, obj) =>
            {
                bool confirmDelete = ((RemoveRunContentView)sender).Result;

                if (confirmDelete)
                {
                    DeleteRun(TestRunItem);
                }
                PopupNavigation.Instance.PopAsync();

            };

            entryView.CancelButtonEventHandler += (sender, obj) =>
            {
                // Do Validation and decide if it should close
                deleteConfirmPopup.PageClosedTaskCompletionSource.SetResult(false);
                cell.Opacity = 1.0;
                PopupNavigation.Instance.PopAsync();
            };

            await PopupNavigation.Instance.PushAsync(deleteConfirmPopup);
        }

The await on the second to last line seems to not wait but continues on.

Does any one have any suggestions for fixing this?

TIA,
Ron L


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>