Provides data for the IContent.OnNavigatingFrom method and the ModernFrame.Navigating event.
Inheritance: NavigationBaseEventArgs
        void IContent.OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            if (InterfaceHelpers.CheckIfNavigationIsAllowed(e.Source.OriginalString) == false)
                e.Cancel = true;

            if (_isMinerRunning)
            {
                MessageBoxResult doNavigateAway =
                    ModernDialog.ShowMessage("Changing the view will cancel the mining-process. Continue?", "navigate",
                        MessageBoxButton.YesNo);
                if (doNavigateAway == MessageBoxResult.No)
                {
                    e.Cancel = true;
                    return;
                }
            }

            if (_cancellationTokenSource != null)
                _cancellationTokenSource.Cancel();

            Cursor = Cursors.Arrow;
            _isMinerRunning = false;
            ProgressBar.Visibility = Visibility.Hidden;

            StartCalculationButton.IsEnabled = true;
            CancelCalculationButton.IsEnabled = false;
            MiningInfo.BBCode = "Click 'Start' to start mining " +
                                MainWindow.MatrixSelection.GetFields().Count +
                                " Fields using the " +
                                MinerSettings.MinerName + ".";

            InterfaceHelpers.MiningIsCompleted = false;
        }
Ejemplo n.º 2
0
 public void OnNavigatingFrom(FirstFloor.ModernUI.Windows.Navigation.NavigatingCancelEventArgs e)
 {
     if (selectedPersonID != 0)
     {
         GlobalCache.currentPersonID = selectedPersonID;
     }
 }
Ejemplo n.º 3
0
 public void OnNavigatingFrom(FirstFloor.ModernUI.Windows.Navigation.NavigatingCancelEventArgs e)
 {
     /*if (e.Source.OriginalString == "SyncDatabaseDumbyURI")
      * {
      *  e.Cancel = true;
      * }*/
     return;
 }
Ejemplo n.º 4
0
 public void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     if (e.Source.ToString() == "Close")
     {
         var parentWindow = Window.GetWindow(this);
         if (parentWindow != null) parentWindow.Close();
         e.Cancel = true;
     }
 }
 /// <summary>
 /// Sets the AlphamMiner Type
 /// </summary>
 /// <param name="e"></param>
 void IContent.OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     if (AlphaMinerRadioButton.IsChecked == true)
         MinerSettings.AddOrUpdateKey("Alphaminer", AlphaMinerRadioButton.Name);
     else if (AlphaMinerPlusRadioButton.IsChecked == true)
         MinerSettings.AddOrUpdateKey("AlphaMiner", AlphaMinerPlusRadioButton.Name);
     else if (AlphaMinerPlusPlusRadioButton.IsChecked == true)
         MinerSettings.AddOrUpdateKey("AlphaMiner", AlphaMinerPlusPlusRadioButton.Name);
 }
Ejemplo n.º 6
0
 public void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     if (e.Source.ToString() == "CreateNewUser")
     {
         var vm = DataContext as MainWindowViewModel;
         if (vm != null) vm.AddNewUserCommand.Execute(true);
         e.Cancel = true;
     }
 }
 /// <summary>
 /// Handles the <see cref="E:NavigatingFrom"/> event.
 /// </summary>
 /// <param name="e">The <see cref="FirstFloor.ModernUI.Windows.Navigation.NavigatingCancelEventArgs"/> instance containing the event data.</param>
 public void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     Debug.WriteLine("ModernUserControl - OnNavigatingFrom");
     if (NavigatingFrom != null)
     {
         NavigatingFrom(this, e);
     }
     Debug.WriteLine("ModernUserControl - OnNavigatingFrom event called");
 }
 void IContent.OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     if (InductiveminerRadioButton.IsChecked == true)
         MinerSettings.AddOrUpdateKey("InductiveMiner", "InductiveMiner");
     else if (InductiveminerInfrequentRadioButton.IsChecked == true)
     {
         MinerSettings.AddOrUpdateKey("InductiveMiner", "InductiveMinerInfrequent");
         MinerSettings.AddOrUpdateKey("InductiveThresholdSlider", InductiveThresholdSlider.Value);
     }
 }
        void IContent.OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            if (DBWorker.MetaData.EventClassifier == "")
            {
                e.Cancel = true;
                ModernDialog.ShowMessage("Please select a classifier", "Metadata", MessageBoxButton.OK);
            }

            if (InterfaceHelpers.CheckIfNavigationIsAllowed(e.Source.OriginalString) == false)
                e.Cancel = true;
        }
        void IContent.OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            if (DBWorker.MetaData == null && e.Source.OriginalString == "/Pages/P2metadata.xaml")
            {
                ModernDialog.ShowMessage("You have to establish a database connection first.", "Connection", MessageBoxButton.OK);
                e.Cancel = true;
            }

            if (InterfaceHelpers.CheckIfNavigationIsAllowed(e.Source.OriginalString) == false)
                e.Cancel = true;
        }
Ejemplo n.º 11
0
        public void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            // ask user if navigating away is ok
            string frameDescription;
            if (e.IsParentFrameNavigating){
                frameDescription = "A parent frame";
            }
            else {
                frameDescription = "This frame";
            }

            // modern message dialog supports BBCode tags
            var question = string.Format(CultureInfo.CurrentUICulture, "[b]{0}[/b] is about to navigate to new content. Do you want to allow this?", frameDescription);

            if (MessageBoxResult.No == ModernDialog.ShowMessage(question, "navigate", System.Windows.MessageBoxButton.YesNo)) {
                e.Cancel = true;
            }
        }
Ejemplo n.º 12
0
 /// <summary>
 /// Called just before this instance is no longer the active content in a frame.
 /// </summary>
 /// <param name="e">An object that contains the navigation data.</param>
 /// <remarks>
 /// The method is also invoked when parent frames are about to navigate.
 /// </remarks>
 public void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
 }
Ejemplo n.º 13
0
 public void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     ((ListViewModel)DataContext).SelectedManga = null;
 }
 private void Frame_Navigating(object sender, NavigatingCancelEventArgs e)
 {
 }
 private void Frame_Navigating(object sender, NavigatingCancelEventArgs e)
 {
     LogMessage("Navigating: [{0}] {1}\r\n", e.NavigationType, e.Source);
 }
Ejemplo n.º 16
0
        private bool CanNavigate(Uri oldValue, Uri newValue, NavigationType navigationType) {
            var cancelArgs = new NavigatingCancelEventArgs {
                Frame = this,
                Source = newValue,
                IsParentFrameNavigating = true,
                NavigationType = navigationType,
                Cancel = false
            };
            OnNavigating(Content as IContent, cancelArgs);

            // check if navigation cancelled
            if (!cancelArgs.Cancel) return true;

            Debug.WriteLine("Cancelled navigation from '{0}' to '{1}'", oldValue, newValue);

            if (Source != oldValue) {
                // enqueue the operation to reset the source back to the old value
                Dispatcher.BeginInvoke((Action)(() => {
                    _isResetSource = true;
                    SetCurrentValue(SourceProperty, oldValue);
                    _isResetSource = false;
                }));
            }
            return false;
        }
Ejemplo n.º 17
0
 public void OnNavigatingFrom(FirstFloor.ModernUI.Windows.Navigation.NavigatingCancelEventArgs e)
 {
 }
Ejemplo n.º 18
0
        public void OnNavigatingFrom(FirstFloor.ModernUI.Windows.Navigation.NavigatingCancelEventArgs e)
        {
            var dc = DataContext as NetworkInterfacesViewModel;

            dc?.StopRefresh();
        }
Ejemplo n.º 19
0
		private void OnNavigating(IContent content, NavigatingCancelEventArgs e)
		{
			// first invoke child frame navigation events
			foreach (var f in GetChildFrames())
			{
				f.OnNavigating(f.Content as IContent, e);
			}

			e.IsParentFrameNavigating = e.Frame != this;

			// invoke IContent.OnNavigating (only if content implements IContent)
			if (content != null)
			{
				content.OnNavigatingFrom(e);
			}

			// raise the Navigating event
			if (Navigating != null)
			{
				Navigating(this, e);
			}
		}
Ejemplo n.º 20
0
 public void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     TreeView.Items.Clear();
 }
Ejemplo n.º 21
0
 private void FrameContent_Navigating(object sender, NavigatingCancelEventArgs e)
 {
     FrameContent.Visibility = System.Windows.Visibility.Hidden;
 }
 public void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     bool result = e.IsParentFrameNavigating;
 }
Ejemplo n.º 23
0
 public void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     //throw new NotImplementedException();
 }
Ejemplo n.º 24
0
 public void OnNavigatingFrom(FirstFloor.ModernUI.Windows.Navigation.NavigatingCancelEventArgs e)
 {
     //throw new NotImplementedException();
 }
 /// <summary>
 /// Save miner settings.
 /// </summary>
 /// <param name="e"></param>
 void IContent.OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     MinerSettings.AddOrUpdateKey("AdjacencyThresholdSlider", AdjacencyThresholdSlider.Value);
     MinerSettings.AddOrUpdateKey("MaximumRecursionDepthSlider", MaximumRecursionDepthSlider.Value);
 }
Ejemplo n.º 26
0
        private void OnNavigating(IContent content, NavigatingCancelEventArgs e) {
            // first invoke child frame navigation events
            foreach (var f in GetChildFrames()) {
                f.OnNavigating(f.Content as IContent, e);
            }

            e.IsParentFrameNavigating = !ReferenceEquals(e.Frame, this);

            // invoke IContent.OnNavigating (only if content implements IContent)
            content?.OnNavigatingFrom(e);

            // raise the Navigating event
            Navigating?.Invoke(this, e);
        }
Ejemplo n.º 27
0
 private void ModernUserControl_NavigatingFrom(object sender, FirstFloor.ModernUI.Windows.Navigation.NavigatingCancelEventArgs e)
 {
     Messenger.Default.Send(new object[] { "NavigatingFromQueryPage", e });
 }
 public void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     if (InterfaceHelpers.CheckIfNavigationIsAllowed(e.Source.OriginalString) == false)
         e.Cancel = true;
 }
 public void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     AddProjectViewModel = new AddProjectViewModel();
 }
 /// <summary>
 /// Called just before this instance is no longer the active content in a frame.
 /// </summary>
 /// <param name="e">An object that contains the navigation data.</param>
 /// <remarks>
 /// The method is also invoked when parent frames are about to navigate.
 /// </remarks>
 public void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
 }
 void IContent.OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
 }
 /// <summary>
 /// Called just before this instance is no longer the active content in a frame.
 /// </summary>
 /// <param name="e">An object that contains the navigation data.</param>
 /// <remarks>
 /// The method is also invoked when parent frames are about to navigate.
 /// </remarks>
 public void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     MessageBoxResult result = this.NavigateBackToPreviousPage(true);
     if (result == MessageBoxResult.Cancel)
     {
         e.Cancel = true;
     }
     else
     {
         this.cancellationTokenSource.Cancel();
     }
 }
Ejemplo n.º 33
0
 /// <summary>
 /// Called just before this instance is no longer the active content in a frame.
 /// </summary>
 /// <param name="e">
 /// An object that contains the navigation data.
 /// </param>
 /// <remarks>
 /// The method is also invoked when parent frames are about to navigate.
 /// </remarks>
 public void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     Debug.WriteLine("StepsControl- OnNavigatingFrom");
 }