protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { if (!alreadyEned) { EndTest(); } }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { if (geoQ.IsBusy == true) { geoQ.CancelAsync(); } }
/// <summary> /// Called when the user leaves this page. /// Stops the recognition process. /// </summary> /// <param name="e"></param> protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { // terminate the recognizer mRecognizer.TerminateControl(); // call default behaviour base.OnNavigatingFrom(e); }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { myVM.CenterChanged -= myVM_CenterChanged; myVM.CompassChanged -= myVM_CompassChanged; myVM.ErrorRaised -= myVM_ErrorRaised; myVM.PhoneOrientationChanged -= myVM_PhoneOrientationChanged; myMap.MapResolved -= myMap_MapResolved; myVM.InternalSuspend(); for (int i = 1; i < myMap.Children.Count; i++) { myMap.Children.RemoveAt(i); } OnExternalUserControlChanged -= ARMapView_OnExternalUserControlChanged; this.ExternalUserControlPlaceHolder.Children.Clear(); if (myVM.ClickedNearbyLocation != null) { myVM.ClickedNearbyLocation.IsClickedOnView = false; } if (e.NavigationMode == NavigationMode.Back) { NavigationService.Navigate(new Uri("/RealSquare;component/MainPage.xaml", UriKind.Relative)); } base.OnNavigatingFrom(e); }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { if (this.scanTimer != null) { this.scanTimer.Stop(); this.scanTimer.Tick -= this.OnTimerTick; this.scanTimer = null; } if (this.phoneCamera != null) { this.phoneCamera.CancelFocus(); this.phoneCamera.Initialized -= this.OnCameraInitialized; this.phoneCamera.Dispose(); } if (this.barcodeReader != null) { this.barcodeReader.ResultFound -= this.OnBarcodeResultFound; this.barcodeReader = null; } if (!this.scanSucceeded && e.NavigationMode == NavigationMode.Back) { this.BarcodeScannerPlugin.OnScanFailed("Cancelled by user"); } }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { webBrowser.Navigating -= webBrowser_Navigating; _locationManager.OnPositionDetermined -= _locationManager_OnPositionDetermined; _locationManager = null; base.OnNavigatingFrom(e); }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { if (e.NavigationMode != NavigationMode.Back) { ViewModel.Tombstone(); } }
private void frame_Navigating(object sender, NavigatingCancelEventArgs e) { if (this.IsBusy) { this.IsBusy = false; } }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { //clean the view model ViewModel.Cleanup(); base.OnNavigatingFrom(e); }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { ViewModels.ViewModelLocator.MainWindowViewModelStatic.SaveSettings(); SelectAccountButton.Click -= SelectAccountButton_Click; base.OnNavigatingFrom(e); }
private void BrowserNavigating(object sender, NavigatingCancelEventArgs e) { if (!e.Uri.ToString().StartsWith(RedirectUri, StringComparison.OrdinalIgnoreCase)) { // we need to ignore all navigation that isn't to the redirect uri. return; } try { OAuth2Response result = DropboxOAuth2Helper.ParseTokenFragment(e.Uri); if (result.State != this.oauth2State) { return; } this.AccessToken = result.AccessToken; this.Uid = result.Uid; this.Result = true; } catch (ArgumentException) { // There was an error in the URI passed to ParseTokenFragment } finally { e.Cancel = true; this.Close(); } }
private void Browser_OnNavigating(object sender, NavigatingCancelEventArgs e) { var url = e.Uri.ToString(); Logger.LogInfo("--> " + url); if (url.Contains("#access_token")) { var token = url.Split('#')[1].Split('&')[0].Split('=')[1]; e.Cancel = true; _Callback(token); Hide(); } //Hide the window when an error is shown... facebook with display its own error in the browser //else if (url.Contains("error_code")) //{ // var queryParameters = url.Split('?')[1].Split('&'); // var errorCode = queryParameters.FirstOrDefault(x => x.Contains("error_code")).Split('=')[1]; // var errorMessage = queryParameters.FirstOrDefault(x => x.Contains("error_message")).Split('=')[1]; // ErrorCode.Content = errorCode; // ErrorMessage.Content = errorMessage; // ErrorInfo.Visibility = Visibility.Visible; // Loader.Visibility = Visibility.Collapsed; // Browser.Visibility = Visibility.Collapsed; //} else { Title = "Login"; Loader.Visibility = Visibility.Collapsed; Browser.Visibility = Visibility.Visible; } }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { if (_camera == null) return; // Dispose camera to minimize power consumption and to expedite shutdown. _camera.Dispose(); }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { App.Camera.Focused -= Camera_Focused; App.Camera.PhotoCaptured -= Camera_PhotoCaptured; base.OnNavigatingFrom(e); }
private void webView_Navigating(object sender, NavigatingCancelEventArgs e) { if (e.Uri.ToString().StartsWith(_callbackUri.AbsoluteUri)) { if (e.Uri.AbsoluteUri.Contains("#")) { AuthorizeResponse = new AuthorizeResponse(e.Uri.AbsoluteUri); } else { var document = (IHTMLDocument3)((WebBrowser)sender).Document; var inputElements = document.getElementsByTagName("INPUT").OfType<IHTMLElement>(); var resultUrl = "?"; foreach (var input in inputElements) { resultUrl += input.getAttribute("name") + "="; resultUrl += input.getAttribute("value") + "&"; } resultUrl = resultUrl.TrimEnd('&'); AuthorizeResponse = new AuthorizeResponse(resultUrl); } e.Cancel = true; this.Visibility = Visibility.Hidden; if (Done != null) { Done.Invoke(this, AuthorizeResponse); } } }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { // If the session is still in progress, save it and we can resume it later. // TODO Save what the user has currently typed into the box try { using (var storage = IsolatedStorageFile.GetUserStoreForApplication()) { // Treat the back key as exiting and not saving if ((session != null && !session.IsFinished) && e.NavigationMode != NavigationMode.Back) { using (var file = storage.OpenFile("Session", FileMode.Create, FileAccess.Write, FileShare.None)) { using (var sw = new StreamWriter(file)) { var json = session.ToJson(new JsonContext()); JsonValue.WriteMin(json, sw); } } } else { storage.DeleteFile("Session"); } } } catch (IsolatedStorageException) { return; } catch (IOException) { return; } catch (FormatException) { return; } base.OnNavigatingFrom(e); }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { // If we did not remove focus from the caption box, binding did not update the value yet imageAttachment.TextNote = textCaption.Text; base.OnNavigatingFrom(e); }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { //stop and reset the game when go away from this page isPlaying = false; isStarted = false; //stop accelerometre reading acl.Stop(); //reset the speed of the ball speedX = -5; speedY = -5; //stop the bar speedBar = 0; //save the existing amount for new level calculating IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings; if (!settings.Contains("Amount")) { //create the data if it hasn't been created yet settings.Add("Amount", rectsAmount.ToString()); } else { settings["Amount"] = rectsAmount.ToString(); } settings.Save(); }
/* * protected override void OnOrientationChanged(OrientationChangedEventArgs e) * { * if (cam != null) * { * // LandscapeRight rotation when camera is on back of phone. * int landscapeRightRotation = 180; * * // Change LandscapeRight rotation for front-facing camera. * if (cam.CameraType == CameraType.FrontFacing) landscapeRightRotation = -180; * * // Rotate video brush from camera. * if (e.Orientation == PageOrientation.LandscapeRight) * { * // Rotate for LandscapeRight orientation. * videoBrush.RelativeTransform = * new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = landscapeRightRotation }; * } * else * { * // Rotate for standard landscape orientation. * videoBrush.RelativeTransform = * new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 0 }; * } * } * * /* * if( cam != null ) * { * Dispatcher.BeginInvoke (() => * { * double rotation = cam.Orientation; * * switch (this the Orientation) * { * case PageOrientation.LandscapeLeft: * rotation = cam.Orientation - 90; * break; * * case PageOrientation.LandscapeRight: * rotation = cam.Orientation + 90; * break; * } * } * } * * * base.OnOrientationChanged(e); * } */ protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { if (cam != null) { cam.Dispose(); } }
private void HandleNavigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (e.NavigationMode == NavigationMode.Back) { e.Cancel = true; } }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { if (e.NavigationMode == NavigationMode.New && e.Uri.ToString() == "/BaconographyWP8Core;component/MainPage.xaml" && e.IsCancelable) e.Cancel = true; else base.OnNavigatingFrom(e); }
/// <summary> /// On click on webBrowser /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void webBrowser1_Navigating(object sender, NavigatingCancelEventArgs e) { HideScriptErrors(webBrowser1,true); load(true,e); }
void ErrorBrowser_Navigating(object sender, NavigatingCancelEventArgs e) { if (firstLoad) { firstLoad = false; return; } // cancel navigation to the clicked link in the webBrowser control e.Cancel = true; string url = e.Uri.ToString(); if(url.StartsWith("about:forum")) url = url.Replace("about:forum", "http://www.interlopers.net/forum"); if (url.StartsWith("about:tutorials")) url = url.Replace("about:forum", "http://www.interlopers.net/tutorials"); var startInfo = new ProcessStartInfo { FileName = url }; Process.Start(startInfo); }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { Browser.Navigating -= this.Browser_Navigating; Browser.NavigationFailed -= this.Browser_NavigationFailed; base.OnNavigatingFrom(e); }
private void Frame_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (e.NavigationMode == NavigationMode.Forward) { e.Cancel = true; } }
private void HandleNavigation(NavigatingCancelEventArgs e) { string s = null; if (e != null && e.Uri != null) { if (e.Uri.IsAbsoluteUri) { s = e.Uri.LocalPath; } else { s = e.Uri.ToString(); } if (s.StartsWith("//", StringComparison.InvariantCulture)) { s = s.Substring(1); } int i = s.IndexOf(";component",0, StringComparison.InvariantCulture); if (i >= 0) { s = s.Substring(i + 10); } #if DEBUG_ANALYTICS Debug.WriteLine("Analytics: " + s); #endif UpdateImage(s, DateTimeOffset.UtcNow); } else { } }
/// <summary> /// Executes when leaving the page /// </summary> /// <param name="e"></param> protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { base.OnNavigatingFrom(e); if (!cancel) //if navigation is caused not by pressing the Cancel button { //default index is the size of App.ViewModel.Tasks - element with default index doesn't exist int index = App.ViewModel.Tasks.Count; //ViewModel MainViewModel model = (MainViewModel) DataContext; //looking for the person, to whom taskList a new task should be added for (int i = 0; i < model.Names.Count; i++) { if (checkedName == model.Names[i].PersonName) { index = model.Names[i].Id; //saving the index(Id) of the person, to whom taskList a new task should be added } } //if index is not default if (index < App.ViewModel.Tasks.Count) { //Adding a task to taskList of "checked(in CheckBox)" person App.ViewModel.Tasks[index].Add(new ItemViewModel() {TaskName = EnterNameBox.Text, Category = category}); } App.ViewModel.SaveData(); } }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { if (State.ContainsKey(FocusedElement)) { State.Remove(FocusedElement); } var focusedElement = FocusManager.GetFocusedElement() as Control; if (focusedElement == null) return; if (!String.IsNullOrEmpty(focusedElement.Name)) { State.Add(FocusedElement, focusedElement.Name); } BindingExpression be = null; //TODO - Developers, add additional controls here like a date picker, combobox, etc. if (focusedElement is TextBox) { be = focusedElement.GetBindingExpression(TextBox.TextProperty); } if (be != null) { be.UpdateSource(); } base.OnNavigatingFrom(e); }
private async void webView_Navigating(object sender, NavigatingCancelEventArgs e) { AuthorizeResponse response; if (e.Uri.ToString().StartsWith(_settings.RedirectUri)) { if (e.Uri.AbsoluteUri.Contains("#")) { response = new AuthorizeResponse(e.Uri.AbsoluteUri); } // form_post support else { var document = (IHTMLDocument3)((WebBrowser)sender).Document; var inputElements = document.getElementsByTagName("INPUT").OfType<IHTMLElement>(); var resultUrl = "?"; foreach (var input in inputElements) { resultUrl += input.getAttribute("name") + "="; resultUrl += input.getAttribute("value") + "&"; } resultUrl = resultUrl.TrimEnd('&'); response = new AuthorizeResponse(resultUrl); } e.Cancel = true; this.Visibility = Visibility.Hidden; var loginResult = await ValidateResponseAsync(response); Done?.Invoke(this, loginResult); } }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { base.OnNavigatingFrom(e); var viewModel = DataContext as INavigationAware; if (viewModel != null) viewModel.OnNavigatingFrom(new NavigatingCancelContext(e.IsCancelable, (NavigationMode)e.NavigationMode, () => e.Cancel, (cancel) => e.Cancel = cancel)); }
private void Browser_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (!e.Uri.AbsoluteUri.ToString().StartsWith(RedirectUri.ToString(), StringComparison.OrdinalIgnoreCase)) { return; } try { OAuth2Response result = DropboxOAuth2Helper.ParseTokenFragment(e.Uri); if (result.State != DBoauth2State) { return; } this.AccessToken = result.AccessToken; this.Uid = result.Uid; this.Result = true; } catch (ArgumentException) { } finally { e.Cancel = true; this.Close(); } }
void RootFrame_Navigating(object sender, NavigatingCancelEventArgs e) { //TODO just for testing. Remove folowing line /*if(IsolatedStorageSettings.ApplicationSettings.Contains("user") == false) IsolatedStorageSettings.ApplicationSettings.Add("user", API.Mock.UserMock.GetUser());*/ //End of TODO if (IsolatedStorageSettings.ApplicationSettings.Contains("user") == true || e.Uri.OriginalString.Equals("app://external/")) { RootFrame.Navigating -= RootFrame_Navigating; return; } else { e.Cancel = true; RootFrame.Dispatcher.BeginInvoke(delegate { RootFrame.Navigating -= RootFrame_Navigating; RootFrame.Navigate(new Uri("/LoginRegisterPage.xaml", UriKind.Relative)); }); } }
private void OnNavigating(object sender, NavigatingCancelEventArgs args) { _lastMode = args.NavigationMode; var handler = Navigating; if (handler != null) handler(this, new NavigatingCancelEventArgsWrapper(args)); }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { //we're navigating away from this page, we won't be scanning any barcodes _scanTimer.Stop(); if (_phoneCamera != null) { // Cleanup _phoneCamera.Dispose(); _phoneCamera.Initialized -= Camera_Initialized; CameraButtons.ShutterKeyHalfPressed -= CameraButtons_ShutterKeyHalfPressed; } if (_scanConfirmation.IsOpen) { _scanConfirmation.IsOpen = false; } if (OpticalReaderTask.TaskPending) { if (e.NavigationMode == NavigationMode.Back) { OpticalReaderTask.CancelTask(true); } else { OpticalReaderTask.CancelTask(false); } } }
void browser_Navigating(object sender, NavigatingCancelEventArgs e) { LastUri = e.Uri; var uri = e.Uri.ToString(); // If the configuration has an SuccessUri configured, // we check if we should close this window or not incase // the browser is arrived on the success page. if (!string.IsNullOrEmpty(builder.SuccessUri)) { if (configuration.DisplayName == "Yammer" || configuration.DisplayName == "Facebook") { if (uri.Contains(builder.SuccessUri)) { Success = true; e.Cancel = true; Close(); } } else { if (uri.StartsWith(builder.SuccessUri)) { Success = true; e.Cancel = true; Close(); } } } addressTextBox.Text = uri; loading.Visibility = Visibility.Visible; ((Storyboard)FindResource("RunLoaderStoryboard")).Begin(); }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { // Das Suchen nach Peers beenden PeerFinder.Stop(); base.OnNavigatingFrom(e); }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { if (cam != null) { cam.Dispose(); cam.CaptureImageAvailable -= cam_CaptureImageAvailable; } }
void RootFrame_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (_reset && e.IsCancelable && e.Uri.OriginalString == "/Views/MainPage.xaml") { e.Cancel = true; _reset = false; } }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { myVM.Suspend(); myVM.OnGotoSettings -= myVM_OnGotoSettings; base.OnNavigatingFrom(e); }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { //Debug.WriteLine(e.Uri); //if(e.Uri.AbsoluteUri=="") //{ // isguanggao = true; //} base.OnNavigatingFrom(e); }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { myVM.PhoneOrientationChanged -= myVM_PhoneOrientationChanged; _gameTimer.Update -= _gameTimer_Update; _gameTimer.Draw -= _gameTimer_Draw; OnExternalUserControlChanged -= ARView_OnExternalUserControlChanged; this.ExternalUserControlPlaceHolder.Children.Clear(); myVM.Suspend(); if (_motion != null) { _motion.Stop(); _motion.Dispose(); _motion = null; } if (_cam != null) { _cam.Dispose(); _cam = null; } // Stop the timer if (_gameTimer != null) { _gameTimer.Stop(); _gameTimer.Dispose(); } //Stop gesture Timer if (_gestureTimer != null) { _gestureTimer.Stop(); _gestureTimer = null; } // Set the sharing mode of the graphics device to turn off XNA rendering SharedGraphicsDeviceManager.Current.GraphicsDevice.SetSharingMode(false); foreach (LocationsVM.Location l in myVM.SelectedNearbyLocations) { placeholderGrid.Children.Remove(l.PlacemarkPresenter); radarCanvas.Children.Remove(l.RadarPointRepresenter); l.IsClickedOnView = false; l.IsAnimatingView = false; l.IsAnimatingWorld = false; } //if (e.NavigationMode == NavigationMode.Back) // NavigationService.Navigate(new Uri("/RealSquare;component/MainPage.xaml", UriKind.Relative)); base.OnNavigatingFrom(e); }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { if (_photoCamera != null) { _timer.Stop(); _photoCamera.CancelFocus(); _photoCamera.Dispose(); } base.OnNavigatingFrom(e); }
private void webBrowser1_LoadCompleted(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { //Uri webURL = new Uri("http://www.wikipedia.com", UriKind.RelativeOrAbsolute); //this.WebBrowserGrid.Navigate(webURL); //WebBrowserGrid.Source = "http://www.wikipedia.com"; //WebBrowserGrid.Navigate("http://www.wikipedia.com"); //dynamic doc = WebBrowserGrid.Document; //this.AnimeTitleTxt = GetPropertyValue<string>(doc, "Title"); }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { if (cam != null) { // Dispose of the camera to minimize power consumption and to expedite shutdown. cam.Dispose(); // Release memory, ensure garbage collection. cam.Initialized -= cam_Initialized; } }
private void OnNavigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (e.NavigationMode != NavigationMode.Back) { this.canInvokeCommand = true; } else { this.canInvokeCommand = false; } }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { //we're navigating away from this page, we won't be scanning any barcodes _scanTimer.Stop(); if (_phoneCamera != null) { // Cleanup _phoneCamera.Dispose(); _phoneCamera.Initialized -= cam_Initialized; CameraButtons.ShutterKeyHalfPressed -= CameraButtons_ShutterKeyHalfPressed; } }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { this.Dispatcher.BeginInvoke(delegate() { txtDebug.Text = "Navigating away from the main page."; }); // Stop other services also accel_timer.Stop(); accelerometer.stop(); app_comsocket.Close(); app_camera.source_set = false; app_camera.focus_busy = false; }
private void wbSample_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { foreach (string s in prohibitedKeywords) { if (e.Uri.OriginalString.ToLower().Contains(s)) { e.Cancel = true; MessageBox.Show("This web site is prohibited", "Prohibited", MessageBoxButton.OK, MessageBoxImage.Exclamation); break; } } txtUrl.Text = e.Uri.OriginalString; }
void SplashPage_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (!_allowDirectNavigation) { e.Cancel = true; _navArgs = e; this.SplashPage.IsHitTestVisible = false; DoubleAnimation da = new DoubleAnimation(0.3d, new Duration(TimeSpan.FromMilliseconds(300))); da.Completed += FadeOutCompleted; this.SplashPage.BeginAnimation(OpacityProperty, da); } _allowDirectNavigation = false; }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { if (_photoCamera != null) { // nama 3 ovat omia lisayksia _previewVideo = null; CameraButtons.ShutterKeyHalfPressed -= (o, arg) => _photoCamera.Focus(); _timer.Tick -= (o, arg) => ScanPreviewBuffer(); _photoCamera.Initialized -= OnPhotoCameraInitialized; _photoCamera.Dispose(); } }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { if (cam != null) { // Dispose camera to minimize power consumption and to expedite shutdown. cam.Dispose(); // Release memory, ensure garbage collection. cam.Initialized -= cam_Initialized; cam.CaptureCompleted -= cam_CaptureCompleted; cam.CaptureImageAvailable -= cam_CaptureImageAvailable; cam.CaptureThumbnailAvailable -= cam_CaptureThumbnailAvailable; } }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { if (cam != null) { //Close camera cam.Dispose(); //Release memory cam.Initialized -= cam_Initialized; cam.CaptureCompleted -= cam_CaptureCompleted; cam.CaptureImageAvailable -= cam_CaptureImageAvailable; cam.CaptureThumbnailAvailable -= cam_CaptureThumbnailAvailable; CameraButtons.ShutterKeyPressed -= OnButtonFullPress; } }
private void Frame_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { var fr = sender as Frame; // If we're navigating to the place where we're already at, the user might have already // clicked on a link and navigated somewhere else, so we need to do a refresh, but // be careful of that creating an infinite loop if (fr != null && fr.CurrentSource == fr.Source) { // need to refresh if (e.NavigationMode != NavigationMode.Refresh) { e.Cancel = true; fr.NavigationService.Refresh(); } } }
private void ViewMain_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { var ta = new ThicknessAnimation(); ta.Duration = TimeSpan.FromSeconds(0.5); ta.DecelerationRatio = 0.7; ta.To = new Thickness(0, 0, 0, 0); if (e.NavigationMode == NavigationMode.New) { ta.From = new Thickness(0, 100, 0, 0); } else if (e.NavigationMode == NavigationMode.Back) { ta.From = new Thickness(0, 0, 0, 100); } (e.Content as Page).BeginAnimation(MarginProperty, ta); }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { if (cameraDevice != null) { try { isProcessing = true; stopCamera(); } catch (Exception e2) { Debug.WriteLine("Camera closing error: " + e2.Message); } } if ((param_OverlayMode & OverlayMode.OM_MW) > 0) { MWOverlay.removeOverlay(); } base.OnNavigatingFrom(e); }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { try { if (cam != null) { // Dispose camera to minimize power consumption and to expedite shutdown. cam.Dispose(); // Release memory, ensure garbage collection. cam.Initialized -= cam_Initialized; cam.CaptureImageAvailable -= cam_CaptureImageAvailable; //cam.CaptureThumbnailAvailable -= cam_CaptureThumbnailAvailable; cam.AutoFocusCompleted -= cam_AutoFocusCompleted; CameraButtons.ShutterKeyHalfPressed -= OnButtonHalfPress; CameraButtons.ShutterKeyPressed -= OnButtonFullPress; CameraButtons.ShutterKeyReleased -= OnButtonRelease; } } catch (Exception ex) { LittleWatson.ReportException(ex); } }
void FrameEx_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (this.CurrentSource != null) { if (this.CurrentSource.Equals(e.Uri)) { Application.Current.MainWindow.Cursor = Cursors.Arrow; } } if (e.NavigationMode == NavigationMode.New) { var Entry = this.GetJournalEntry(); if (Entry != null) { JournalEntryArray = new JournalEntry[Entry.Count]; Entry.CopyTo(JournalEntryArray); } } else { JournalEntryArray = null; } }
private void NavigationFrame_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (_navigatingUri == null || _navigatingUri.OriginalString != e.Uri.OriginalString) { Uri uri = e.Uri ?? NavigationFrame.CurrentSource; #region ** uri mappings if (IsSampleUri(uri)) { _navigatingUri = new Uri(SAMPLEURL_PREFIX + uri.OriginalString, UriKind.Relative); } else { _navigatingUri = uri; } #endregion _navigationMode = e.NavigationMode; e.Cancel = true; Action a = () => { Loader.Visibility = Visibility.Collapsed; _targetUri = _navigatingUri; NavigationFrame.Navigate(_navigatingUri); }; if (_currentUri != null && InDifferentControls(_navigatingUri, _currentUri) || _currentUri != null && (!IsSampleUri(_currentUri) || !IsSampleUri(_navigatingUri))) { ContentUnloaded(_currentUri, _navigatingUri, a); } else if (_navigatingUri != null && _currentUri != _navigatingUri) { Dispatcher.BeginInvoke(new Action(a)); } } }
private void Frame_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (e.Content == null || (e.Content as string) == string.Empty) { return; } var ta = new ThicknessAnimation { Duration = TimeSpan.FromSeconds(0.3), DecelerationRatio = 0.7, To = new Thickness(0, 0, 0, 0) }; if (e.NavigationMode == NavigationMode.New) { ta.From = new Thickness(500, 0, 0, 0); } else if (e.NavigationMode == NavigationMode.Back) { ta.From = new Thickness(0, 0, 500, 0); } (e.Content as Page).BeginAnimation(MarginProperty, ta); }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { m_bInThisApp = false; }