Пример #1
0
        public NavigationService(Frame frame)
        {
            _frame = new FrameFacade(frame);
            _frame.Navigating += async (s, e) =>
            {
                if (e.Suspending)
                    return;

                // allow the viewmodel to cancel navigation
                e.Cancel = !NavigatingFrom(false);
                if (!e.Cancel)
                {
                    await NavigateFromAsync(false);
                }
            };
            _frame.Navigated += (s, e) =>
            {
                NavigateTo(e.NavigationMode, e.Parameter);
            };
        }
Пример #2
0
        public NavigationService(Frame frame)
        {
            _frame             = new FrameFacade(frame);
            _frame.Navigating += async(s, e) =>
            {
                if (e.Suspending)
                {
                    return;
                }

                // allow the viewmodel to cancel navigation
                e.Cancel = !NavigatingFrom(false);
                if (!e.Cancel)
                {
                    await NavigateFromAsync(false);
                }
            };
            _frame.Navigated += (s, e) =>
            {
                NavigateTo(e.NavigationMode, e.Parameter);
            };
        }