public void OnBackRequesting(HandledRoutedEventArgs e)
        {
            //Unload();
            //Dispose();

            e.Handled = true;
        }
 public void OnBackRequested(HandledRoutedEventArgs args)
 {
     if (ViewModel.SelectionMode != ListViewSelectionMode.None)
     {
         ViewModel.SelectionMode = ListViewSelectionMode.None;
         args.Handled            = true;
     }
 }
 public void OnBackRequested(HandledRoutedEventArgs args)
 {
     if (ContentPanel.Visibility == Visibility.Collapsed)
     {
         SearchField.Text = string.Empty;
         Search_LostFocus(null, null);
         args.Handled = true;
     }
 }
        public void RaiseForwardRequested(HandledRoutedEventArgs args)
        {
            ForwardRequested?.Invoke(this, args);

            if (!args.Handled && Frame.ForwardStack.Count > 0)
            {
                GoForward();
            }
        }
        public void RaiseBackRequested(HandledRoutedEventArgs args)
        {
            BackRequested?.Invoke(this, args);

            if (BackButtonHandling == BootStrapper.BackButton.Attach && !args.Handled && (args.Handled = Frame.BackStackDepth > 0))
            {
                GoBack();
            }
        }
示例#6
0
        public void OnBackRequesting(HandledRoutedEventArgs e)
        {
            if (!_wasFullScreen)
            {
                ApplicationView.GetForCurrentView().ExitFullScreenMode();
            }

            Unload();
            Dispose();

            e.Handled = true;
        }
示例#7
0
        private void OnBackRequested(object sender, HandledRoutedEventArgs args)
        {
            //var type = BackStackType.Navigation;
            //if (_backStack.Count > 0)
            //{
            //    type = _backStack.Last.Value;
            //    _backStack.RemoveLast();
            //}

            if (ParentFrame.Content is INavigatingPage masterPaging && CurrentState != MasterDetailState.Minimal)
            {
                masterPaging.OnBackRequesting(args);
                if (args.Handled)
                {
                    return;
                }
            }

            if (DetailFrame.Content is INavigablePage detailPage /*&& type == BackStackType.Navigation*/)
            {
                detailPage.OnBackRequested(args);
                if (args.Handled)
                {
                    return;
                }
            }

            // TODO: maybe checking for the actual width is not the perfect way,
            // but if it is 0 it means that the control is not loaded, and the event shouldn't be handled
            if (CanGoBack && ActualWidth > 0 /*&& type == BackStackType.Navigation*/)
            {
                DetailFrame.GoBack();
                args.Handled = true;
            }
            else if (ParentFrame.Content is INavigablePage masterPage /*&& type == BackStackType.Hamburger*/)
            {
                masterPage.OnBackRequested(args);
                if (args.Handled)
                {
                    return;
                }
            }
            else if (ParentFrame.CanGoBack && ActualWidth > 0)
            {
                ParentFrame.GoBack();
                args.Handled = true;
            }
        }
示例#8
0
        public void OnBackRequested(HandledRoutedEventArgs args)
        {
            if (_scrollingHostDisabled)
            {
                _scrollingHostDisabled = false;
                SharedMedia.SetScrollMode(false);

                //SetScrollMode(true);
                ScrollingHost.VerticalScrollMode          = ScrollMode.Auto;
                ScrollingHost.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
                ScrollingHost.ChangeView(null, 0, null, false);

                ScrollingInfo.Visibility = Visibility.Visible;
                InfoPanel.Visibility     = Visibility.Collapsed;

                args.Handled = true;
            }
        }
 protected override void OnBackRequestedOverride(object sender, HandledRoutedEventArgs e)
 {
     if (IsEditingCompression)
     {
         e.Handled            = true;
         IsEditingCompression = false;
     }
     else if (IsEditingCropping)
     {
         e.Handled         = true;
         IsEditingCropping = false;
     }
     else
     {
         e.Handled = true;
         Hide(ContentDialogResult.None);
     }
 }
示例#10
0
        private void RaiseForwardRequested()
        {
            DebugWrite();

            var args = new HandledRoutedEventArgs();

            ForwardRequested?.Invoke(null, args);
            if (args.Handled)
            {
                return;
            }
            foreach (var frame in WindowContext.GetForCurrentView().NavigationServices.Select(x => x.FrameFacade))
            {
                frame.RaiseForwardRequested(args);
                if (args.Handled)
                {
                    return;
                }
            }

            NavigationService?.GoForward();
        }
        protected override void OnBackRequestedOverride(object sender, HandledRoutedEventArgs e)
        {
            //var container = GetContainer(0);
            //var root = container.Presenter;
            if (_closing != null)
            {
                Presenter.Opacity = 0;
                Preview.Opacity   = 1;

                var root = Preview.Presenter;

                if (SettingsService.Current.AreAnimationsEnabled)
                {
                    var animation = ConnectedAnimationService.GetForCurrentView().PrepareToAnimate("FullScreenPicture", root);
                    if (animation != null)
                    {
                        if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Media.Animation.ConnectedAnimation", "Configuration"))
                        {
                            animation.Configuration = new BasicConnectedAnimationConfiguration();
                        }

                        var element = _closing();
                        if (element.ActualWidth > 0 && animation.TryStart(element))
                        {
                            animation.Completed += (s, args) =>
                            {
                                Hide();
                            };
                        }
                        else
                        {
                            Hide();
                        }
                    }
                    else
                    {
                        Hide();
                    }
                }
                else
                {
                    Hide();
                }
            }
            else
            {
                //var batch = _layout.Compositor.CreateScopedBatch(CompositionBatchTypes.Animation);

                //_layout.StartAnimation("Offset.Y", CreateScalarAnimation(_layout.Offset.Y, (float)ActualHeight));

                //batch.End();
                //batch.Completed += (s, args) =>
                //{
                //    ScrollingHost.Opacity = 0;
                //    Preview.Opacity = 1;

                //    Hide();
                //};
            }

            //_layer.StartAnimation("Opacity", CreateScalarAnimation(1, 0));

            //if (Transport.IsVisible)
            //{
            //    Transport.Hide();
            //}

            //Unload();
            //Dispose();

            e.Handled = true;
        }
 public void OnBackRequested(HandledRoutedEventArgs args)
 {
     View.OnBackRequested(args);
 }
示例#13
0
        /// <summary>
        /// Default Hardware/Shell Back handler overrides standard Back behavior
        /// that navigates to previous app in the app stack to instead cause a backward page navigation.
        /// Views or Viewodels can override this behavior by handling the BackRequested
        /// event and setting the Handled property of the BackRequestedEventArgs to true.
        /// </summary>
        private void RaiseBackRequested(Windows.System.VirtualKey key, ref bool handled)
        {
            DebugWrite();

            var args = new HandledRoutedEventArgs();

            BackRequested?.Invoke(null, args);
            if (handled = args.Handled)
            {
                return;
            }

            var popups = VisualTreeHelper.GetOpenPopups(Window.Current);

            foreach (var popup in popups)
            {
                if (popup.Child is INavigablePage page)
                {
                    if (key == Windows.System.VirtualKey.Escape)
                    {
                        if (popup.Child is INavigatingPage navigating)
                        {
                            navigating.OnBackRequesting(args);
                        }

                        args.Handled = true;
                    }
                    else
                    {
                        page.OnBackRequested(args);
                    }

                    if (handled = args.Handled)
                    {
                        return;
                    }
                }
                else if (popup.Child is ContentDialog dialog)
                {
                    dialog.Hide();
                    return;
                }
                else if (key == Windows.System.VirtualKey.Escape)
                {
                    handled = args.Handled = true;
                    return;
                }
            }

            foreach (var frame in WindowContext.GetForCurrentView().NavigationServices.Select(x => x.FrameFacade).Reverse())
            {
                frame.RaiseBackRequested(args);

                if (handled = args.Handled)
                {
                    return;
                }
            }

            if (NavigationService?.CanGoBack ?? false)
            {
                NavigationService?.GoBack();
            }
        }
示例#14
0
        protected override void OnBackRequestedOverride(object sender, HandledRoutedEventArgs e)
        {
            if (!_wasFullScreen)
            {
                ApplicationView.GetForCurrentView().ExitFullScreenMode();
            }

            if (ViewModel != null)
            {
                ViewModel.Aggregator.Unsubscribe(this);

                ViewModel.Delegate = null;
                ViewModel.Items.CollectionChanged -= OnCollectionChanged;

                Bindings.StopTracking();
            }

#if !MOBILE
            //var container = GetContainer(0);
            //var root = container.Presenter;
            if (ViewModel != null && ViewModel.SelectedItem == ViewModel.FirstItem && _closing != null)
            {
                ScrollingHost.Opacity = 0;
                Preview.Opacity       = 1;

                var root = Preview.Presenter;

                var animation = ConnectedAnimationService.GetForCurrentView().PrepareToAnimate("FullScreenPicture", root);
                if (animation != null)
                {
                    if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Media.Animation.ConnectedAnimation", "Configuration"))
                    {
                        animation.Configuration = new BasicConnectedAnimationConfiguration();
                    }

                    var element = _closing();
                    if (element.ActualWidth > 0 && animation.TryStart(element))
                    {
                        TypedEventHandler <ConnectedAnimation, object> handler = null;
                        handler = (s, args) =>
                        {
                            animation.Completed -= handler;
                            Hide();
                        };

                        animation.Completed += handler;
                    }
                    else
                    {
                        Hide();
                    }
                }
                else
                {
                    Hide();
                }
            }
            else
            {
                var batch = _layout.Compositor.CreateScopedBatch(CompositionBatchTypes.Animation);

                _layout.StartAnimation("Offset.Y", CreateScalarAnimation(_layout.Offset.Y, (float)ActualHeight));

                batch.End();
                batch.Completed += (s, args) =>
                {
#endif
            ScrollingHost.Opacity = 0;
            Preview.Opacity       = 1;

            Hide();
#if !MOBILE
        };
    }

    _layer.StartAnimation("Opacity", CreateScalarAnimation(1, 0));
#endif
            if (Transport.IsVisible)
            {
                Transport.Hide();
            }

            Unload();
            Dispose();

            e.Handled = true;
        }