FormsPopup.Examples.CodedPopupExample.ShowPopup_Clicked C# (CSharp) Method

ShowPopup_Clicked() private method

private ShowPopup_Clicked ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private async void ShowPopup_Clicked(object sender, EventArgs e)
        {
            if (_showingAnimation.On)
            {
                double original;

                await _popup1.ShowAsync(async p =>
                {
                    original = p.Scale;

                    await Task.WhenAll
                    (
                        p.SectionContainer.RelScaleTo(0.05, 100, Easing.CubicOut),
                        p.SectionContainer.RelScaleTo(-0.05, 105, Easing.CubicOut)
                    ).ContinueWith(c =>
                    {
                        Device.BeginInvokeOnMainThread(() =>
                        {
                            p.SectionContainer.Scale = original;
                        });
                    });
                });
            }
            else
            {
                _popup1.Show();
            }
        }
    }