상속: INavigatingCancelEventArgs
예제 #1
0
 public NavigatingEventArgs(NavigatingCancelEventArgs e, Page page)
 {
     NavigationMode = e.NavigationMode;
     PageType = e.SourcePageType;
     Parameter = e.Parameter;
     Page = page;
 }
예제 #2
0
		public void RaiseNavigating(NavigatingCancelEventArgs args)
		{
			if (Navigating != null)
			{
				Navigating(this, args);
			}
		}
예제 #3
0
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     base.OnNavigatingFrom(e);
     MainMap.MapControl.ActualCameraChanged -= MainMap_ActualCameraChanged;
     BandwidthManager.EffectiveBandwidthOptionsChanged -= BandwidthManager_EffectiveBandwidthOptionsChanged;
     MainMap.UnhookLocationEvents();
 }
예제 #4
0
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     if (!(e.Parameter is bool))
         return;
     bool navigatingRight = (bool)e.Parameter;
     EntranceAnimation.FromHorizontalOffset = navigatingRight ? -300 : 300;
 }
예제 #5
0
        /// <summary>
        ///   Occurs before navigation
        /// </summary>
        /// <param name="sender"> The event sender. </param>
        /// <param name="e"> The event args. </param>
        protected virtual void OnNavigating(object sender, NavigatingCancelEventArgs e)
        {
            var handler = Navigating;
            if (handler != null)
                handler(sender, e);

            if (e.Cancel) return;

            var view = _frame.Content as FrameworkElement;
            if (view == null) return;

            var guard = view.DataContext as ICloseGuard;
            if (guard != null)
            {
                var task = guard.CanCloseAsync();
                if (!task.IsCompleted)
                    throw new NotSupportedException("Async task is not supported.");

                if (!task.Result)
                {
                    e.Cancel = true;
                    return;
                }
            }

            var deactivator = view.DataContext as IDeactivate;
            if (deactivator != null)
            {
                deactivator.Deactivate(CanCloseOnNavigating(sender, e));
            }
        }
예제 #6
0
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     if (Animating)
     {
         CompositionTarget.Rendering -= AdvanceAnimation;
     }
 }
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            SpreadingPlotView.Model = null;
            SpreadingPlotView = null;

            base.OnNavigatingFrom(e);
        }
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     // Before we navigate away from the page, we want to generate a new _persistedPosition string. This string contains the key of the item at the top of the 
     // viewing window (generated by the function GetKey) and the offset of that item.
     RestoreScrollPositionSample._persistedPosition = ListViewPersistenceHelper.GetRelativeScrollPosition(this.ItemsListView, this.GetKey);
     base.OnNavigatingFrom(e);
 }
예제 #9
0
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            CashFlowUserControl.Dispose();
            CategorySpreadingUserControl.Dispose();

            base.OnNavigatingFrom(e);
        }
예제 #10
0
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     base.OnNavigatingFrom(e);
     RossPathDisplay.CleanUp();
     //viewModel.CleanUpForPageChange();
     this.viewModel = null;
 }
예제 #11
0
 private void ComponentActivatorOnNavigating(object sender, NavigatingCancelEventArgs e)
 {
     if (e.NavigationMode == NavigationMode.New)
     {
         _storageCoordinator.Save(StorageMode.Temporary);
     }
 }
예제 #12
0
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            controller.RemoveListener(listener);
            controller.Dispose();

            base.OnNavigatingFrom(e);
        }
예제 #13
0
 public NavigatingEventArgs(DeferralManager manager, NavigatingCancelEventArgs e, Page page, object parameter) : this(manager)
 {
     NavigationMode = e.NavigationMode;
     PageType = e.SourcePageType;
     Page = page;
     Parameter = parameter;
 }
예제 #14
0
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     base.OnNavigatingFrom(e);
     var viewModel = DataContext as INavigationAware;
     if (viewModel != null)
         viewModel.OnNavigatingFrom(new NavigatingCancelContext(true, (NavigationMode)e.NavigationMode, () => e.Cancel, (cancel) => e.Cancel = cancel));
 }
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     base.OnNavigatingFrom(e);
     SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
     SystemNavigationManager.GetForCurrentView().BackRequested -= this.Zoom_BackRequested;
     SemanticZoom.ViewChangeStarted -= SemanticZoom_ViewChangeStarted;
 }
예제 #16
0
 public NavigatingArgs(NavigatingCancelEventArgs e)
 {
     NavigationMode = e.NavigationMode.ToNavigationModes();
     NavigationTransitionInfo = e.NavigationTransitionInfo;
     Parameter = e.Parameter;
     SourcePageType = e.SourcePageType;
 }
예제 #17
0
 private void FacadeNavigatingCancelEventHandler(object sender, NavigatingCancelEventArgs e)
 {
     foreach (var handler in _navigatingEventHandlers)
     {
         handler(this, new EventArgs());
     }
 }
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     if (ScenarioDisableButton.IsEnabled)
     {
         ScenarioDisable();
     }
 }
예제 #19
0
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     ((BIRCViewModel)currentDataContext).GetSelectedConnection().OnAddHistory -= MainPage_OnAddHistory;
     ((BIRCViewModel)currentDataContext).OnBeforeServerSelectionChanged -= CurrentDataContext_OnBeforeServerSelectionChanged;
     ((BIRCViewModel)currentDataContext).OnAfterServerSelectionChanged -= CurrentDataContext_OnAfterServerSelectionChanged;
     Loaded -= MainPage_Loaded;
 }
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            azureConnector.OnMessageReceived -= AzureConnector_OnMessageReceived;
            //this.updateTimer?.Cancel();

            base.OnNavigatingFrom(e);
        }
 public NavigatingCancelEventArgsWrapper([NotNull] NavigatingCancelEventArgs args, string parameter, bool bringToFront)
 {
     Should.NotBeNull(args, nameof(args));
     _args = args;
     _parameter = parameter;
     _bringToFront = bringToFront;
 }
        protected virtual void OnNavigating(object sender, NavigatingCancelEventArgs e)
        {
            ExternalNavigatingHandler(sender, e);

            if (e.Cancel)
                return;

            var view = frame.Content as FrameworkElement;

            if (view == null)
                return;

            var guard = view.DataContext as IGuardClose;

            if (guard != null)
            {
                var shouldCancel = false;
                guard.CanClose(result => { shouldCancel = !result; });

                if (shouldCancel)
                {
                    e.Cancel = true;
                    return;
                }
            }

            var deactivator = view.DataContext as IDeactivate;

            if (deactivator != null)
            {
                deactivator.Deactivate(CanCloseOnNavigating(sender, e));
            }
        }
 // Cleanup scenario when it is about to be unloaded.
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     if (m_scenario1ViewModel != null)
     {
         m_scenario1ViewModel.ScenarioCleanup();
     }
 }
        /// <summary>
        /// Invoked when the application is navigating away from this page
        /// </summary>
        /// <param name="e"></param>
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            //Unload group images from memory
            group.UnloadItemsImages();

            base.OnNavigatingFrom(e);
        }
        private async void OnNavigating(object sender, NavigatingCancelEventArgs e)
        {
            await QmunicateLoggerHolder.Log(QmunicateLogLevel.Debug, "OnNavigating. SourcePageType=" + e.SourcePageType + " Mode=" + e.NavigationMode);
            var handler = Navigating;
            if (handler != null)
            {
                handler.Invoke(sender, e);
            }

            //if (!e.Cancel)
            //{
            //    switch (e.NavigationMode)
            //    {
            //        case NavigationMode.Back:
            //            NavigatedFrom(e);
            //            break;
            //        case NavigationMode.Forward:
            //            break;
            //        case NavigationMode.New:
            //            NavigatedFrom(e);
            //            break;
            //        case NavigationMode.Refresh:
            //            break;
            //    }
            //}
        }
예제 #26
0
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     DownloadViewModel.Instance.DownloadingCountChannge -= ChangeDownloadingElement;
     CommonUtils.DownloadSelectAction -= DownPathSelected;
     if (e.NavigationMode == NavigationMode.Back)
         _isDownloading = true;
 }
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            // Remove the back button handle
            (App.Current as App).BackRequested -= App_BackRequested;

            base.OnNavigatingFrom(e);
        }
        protected override async void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            base.OnNavigatingFrom(e);
            Debug.WriteLine(e.SourcePageType);
            if (!isSave)//e.parameter 是否放弃
            {
                if (e.Parameter == null)
                {
                    e.Cancel = true;
                    MessageDialog dialog = new MessageDialog("你尚未保存更改,是否放弃");
                    dialog.Commands.Add(new UICommand("放弃") { Id = true });
                    dialog.Commands.Add(new UICommand("继续编辑") { Id = false });
                    var result = await dialog.ShowAsync();
                    if ((bool)result.Id)
                    {
                        e.Cancel = false;
                        Frame.Navigate(e.SourcePageType, true);
                    }
                    else
                    {
                        e.Cancel = true;

                    }
                }
            }
            else
            {

            }
        }
예제 #29
0
 public NavigatingEventArgs(NavigatingCancelEventArgs e, Page page)
 {
     this.Page = page;
     this.NavigationMode = e.NavigationMode;
     this.PageType = e.SourcePageType;
     this.Parameter = e.Parameter?.ToString();
 }
예제 #30
0
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            base.OnNavigatingFrom(e);

            var navigableViewModel = this.DataContext as INavigable;
            if (navigableViewModel != null)
                navigableViewModel.OnNavigatingFrom(e);
        }
        protected override void OnNavigatingFrom(Windows.UI.Xaml.Navigation.NavigatingCancelEventArgs e)
        {
            if (m_SettingsToStorage != null)
            {
                m_SettingsToStorage.writeDatatoLocalStorage();
            }


            m_Environment.GPIOEnvironmentConnectors.InitializeActiveBanks();
            m_Environment.ProcessorGPIOEvents.Initialize();
            m_Environment.ProcessorGPIOEvents.InitializeProcessEvents();

            m_Environment.StartConnectors();

            base.OnNavigatingFrom(e);
        }
        /*
         * async private void SensorStopConnector()
         * {
         * //  if (m_Connector_SEN0188.ProcessingPackagesStarted)
         *  {
         *      await m_Connector_SEN0188.stopProcessingPackagesAsync();
         *
         *  }
         *
         *
         * }
         *
         *
         * async private void SensorStartConnector()
         * {
         *  if (m_serDev != null)
         *  {
         *   //   if (!m_Connector_SEN0188.ProcessingPackagesStarted)
         *      {
         *          TimeSpan _timeOut = TimeSpan.FromMilliseconds(1000);
         *          m_serDev.BaudRate = (uint)57600;
         *          m_serDev.WriteTimeout = _timeOut;
         *          m_serDev.ReadTimeout = _timeOut;
         *          m_serDev.Parity = Windows.Devices.SerialCommunication.SerialParity.None;
         *          m_serDev.StopBits = Windows.Devices.SerialCommunication.SerialStopBitCount.One;
         *          m_serDev.DataBits = 8;
         *          m_serDev.Handshake = Windows.Devices.SerialCommunication.SerialHandshake.None;
         *
         *
         *          m_Sensorinputconfigoptions["UpdateState"] = PropertyValue.CreateInt32(1);
         *
         *          await m_Connector_SEN0188.startProcessingPackagesAsync(m_serDev, m_Sensorinputconfigoptions, m_Sensoroutputconfigoptions);
         *      }
         *
         *
         *  }
         *
         * }
         */

        protected override void OnNavigatingFrom(Windows.UI.Xaml.Navigation.NavigatingCancelEventArgs e)
        {
            base.OnNavigatingFrom(e);
            m_Connector_SEN0188.NotifyChangeState -= Connector_SEN0188_NotifyChangeState;
        }