public static async void AnimateClose(this PhoneApplicationFrame frame)
        {
            var animations = new List <Task>();

            foreach (var element in AnimationTrigger.CloseElements.ToList())
            {
                var closeDefinition = AnimationTrigger.GetClose(element);
                if (closeDefinition != null)
                {
                    animations.Add(element.AnimateAsync(closeDefinition));
                }
            }

            await Task.WhenAll(animations.ToArray());
        }
Ejemplo n.º 2
0
        private async void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
        {
            if (e.Handled)
            {
                return;
            }

            if (CanGoBack)
            {
                e.Handled     = true;
                animatingBack = true;

                await AnimationTrigger.AnimateClose();

                animatingBack = false;
                GoBack();
            }
        }