public void RequirePasswordUnchecked(object arg) { if (App.SettingsHelper.RequirePassword) { NavigationService.Navigate(ViewLocator.View("Password", new { Mode = "Off" })); } }
public void RequirePasswordChecked(object arg) { if (!App.SettingsHelper.RequirePassword) { NavigationService.Navigate(ViewLocator.View("Password")); } }
private void HandleActions() { if (NavigationContext.QueryString.ContainsKey("Action")) { string action = NavigationContext.QueryString["Action"]; switch (action) { case "Record": NavigationService.Navigate(ViewLocator.View("Record")); break; case "Memo": if (NavigationContext.QueryString.ContainsKey("Id")) { NavigationService.Navigate(ViewLocator.View("Memo", new { Id = NavigationContext.QueryString["Id"] })); } break; case "Tag": if (NavigationContext.QueryString.ContainsKey("Id")) { NavigationService.Navigate(ViewLocator.View("List", new { Filter = "Tag", Id = NavigationContext.QueryString["Id"] })); } break; case "Favorites": NavigationService.Navigate(ViewLocator.View("Favorites")); break; } } }
public virtual void OnNavigating(object sender, NavigatingCancelEventArgs e) { if (_reset && e.IsCancelable && e.Uri == ViewLocator.View("Main")) { e.Cancel = true; _reset = false; } }
public void FavoriteTap(object arg) { var favorite = arg as Favorite; if (favorite != null) { NavigationService.Navigate(ViewLocator.View("Memo", new { Id = favorite.Memo.Id })); } }
public void TagTap(object arg) { var tag = arg as Tag; if (tag != null) { NavigationService.Navigate(ViewLocator.View("List", new { Filter = "Tag", Id = tag.Id })); } }
public void MemoTap(object arg) { var memo = arg as Memo; if (memo != null) { NavigationService.Navigate(ViewLocator.View("Memo", new { Id = memo.Id })); } }
public void Recover(object arg) { #if BETA ShowMessage(AppResources.NotImplementedMessageText, AppResources.NotImplementedMessageCaption, System.Windows.MessageBoxButton.OK); #else NavigationService.Navigate(ViewLocator.View("Recover")); #endif }
private void HandleVoiceCommands() { if (NavigationContext.QueryString.ContainsKey("VoiceCommand")) { string voiceCommand = NavigationContext.QueryString["VoiceCommand"]; switch (voiceCommand) { case "Record": NavigationService.Navigate(ViewLocator.View("Record")); break; case "Show": if (NavigationContext.QueryString.ContainsKey("views")) { string view = NavigationContext.QueryString["views"]; switch (view) { case "all": NavigationService.Navigate(ViewLocator.View("List")); break; case "favorites": NavigationService.Navigate(ViewLocator.View("Favorites")); break; case "map": NavigationService.Navigate(ViewLocator.View("ListMap")); break; } } break; case "Play": if (NavigationContext.QueryString.ContainsKey("plays")) { var plays = NavigationContext.QueryString["plays"]; switch (plays) { case "last recorded": var memo = Recent.FirstOrDefault(); if (memo != null) { NavigationService.Navigate(ViewLocator.View("Memo", new { Id = memo.Id, Action = "Play" })); } break; } } break; } } }
public void Share(object arg) { if (LicenseHelper.IsPremium) { NavigationService.Navigate(ViewLocator.View("Share", new { Id = _memo.Id })); } else { UpgradeToPremium(); } }
public override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { if (NavigationContext.QueryString.ContainsKey("Url")) { _returnUri = new Uri(Uri.UnescapeDataString(NavigationContext.QueryString["Url"]), UriKind.RelativeOrAbsolute); } else { _returnUri = ViewLocator.View("Main"); } }
public void Security(object arg) { if (LicenseHelper.IsPremium) { NavigationService.Navigate(ViewLocator.View("SecuritySettings")); } else { UpgradeToPremium(); } }
public async void SocialShare(object arg) { try { IsUploading = true; string link = null; if (Account.Equals(AppResources.SkyDriveNameText)) { link = await UploadToSkyDriveAsync(true); } if (Account.Equals(AppResources.SoundCloudNameText)) { link = await UploadToSoundCloudAsync(); } if (!string.IsNullOrWhiteSpace(link)) { TaskHelper.ShareSocial(link, _memo.Title); } if (NavigationService.CanGoBack) { NavigationService.GoBack(); } } catch (InvalidOperationException) { if (ShowMessage(string.Format(AppResources.AccountDisconnectedMessageText, Account), AppResources.AccountDisconnectedMessageCaption, System.Windows.MessageBoxButton.OKCancel) == System.Windows.MessageBoxResult.OK) { NavigationService.Navigate(ViewLocator.View("AccountSettings")); } IsUploading = false; } catch { IsUploading = false; ShowToast(AppResources.UploadFailedMessageCaption, string.Format(AppResources.UploadFailedMessageText, Account)); } }
public void Save(object arg) { long timestamp = (DateTime.UtcNow.Ticks - 621355968000000000) / 10000000; var newMemo = new Memo { AudioFile = _fileName, Title = string.Format(AppResources.MemoNameTemplate, timestamp.ToString()), Duration = _recorder.Duration, SampleRate = _recorder.SampleRate, Channels = _recorder.Channels, BitRate = _recorder.BitsRate, AudioFormat = _recorder.EncodingFormat.ToString(), Latitude = _location != null ? _location.Coordinate.Latitude : new Nullable <double>(), Longitude = _location != null ? _location.Coordinate.Longitude : new Nullable <double>() }; LocationHelper.StopTracking(); _isRecording = false; ReleaseRecorder(); Uow.MemoRepository.Add(newMemo); //Uow.Save(); StatusText = AppResources.ReadyStatusText; //if (newMemo.AudioFormat.Equals("MP3")) // StorageHelper.WriteId3Tag(newMemo.AudioFile, null, newMemo.Title, "Voice Memos", "Voice Memos", null); if (App.SettingsHelper.EditDetails) { NavigationService.Navigate(ViewLocator.View("Edit", new { Id = newMemo.Id, SourceView = "Record" })); } else { if (NavigationService.CanGoBack) { NavigationService.GoBack(); } } }
private void CheckForLoginNavigation(object sender, NavigatingCancelEventArgs e) { if (!LicenseHelper.IsPremium) { IsAuthenticated = true; return; } if (SettingsHelper.RequirePassword && !IsAuthenticated && e.NavigationMode == NavigationMode.New && !e.Uri.OriginalString.Contains("LoginView")) { e.Cancel = true; Deployment.Current.Dispatcher.BeginInvoke(() => { var url = Uri.EscapeDataString(e.Uri.OriginalString); RootFrame.Navigate(ViewLocator.View("Login", new { Url = url })); }); } }
public async void Upload(object arg) { try { IsUploading = true; if (Account.Equals(AppResources.SkyDriveNameText)) { await UploadToSkyDriveAsync(false); } if (Account.Equals(AppResources.SoundCloudNameText)) { await UploadToSoundCloudAsync(); } if (NavigationService.CanGoBack) { NavigationService.GoBack(); } } catch (InvalidOperationException) { if (ShowMessage(string.Format(AppResources.AccountDisconnectedMessageText, Account), AppResources.AccountDisconnectedMessageCaption, System.Windows.MessageBoxButton.OKCancel) == System.Windows.MessageBoxResult.OK) { NavigationService.Navigate(ViewLocator.View("AccountSettings")); } IsUploading = false; } catch { IsUploading = false; ShowToast(AppResources.UploadFailedMessageCaption, string.Format(AppResources.UploadFailedMessageText, Account)); } }
public void ChangePassword(object arg) { NavigationService.Navigate(ViewLocator.View("Password", new { Mode = "Change" })); }
public void Recording(object arg) { NavigationService.Navigate(ViewLocator.View("RecordingSettings")); }
public void General(object arg) { NavigationService.Navigate(ViewLocator.View("GeneralSettings")); }
public void Storage(object arg) { NavigationService.Navigate(ViewLocator.View("StorageSettings")); }
public void Edit(object arg) { NavigationService.Navigate(ViewLocator.View("Edit", new { Id = _memo.Id, SourceView = "Memo" })); }
public void About(object arg) { NavigationService.Navigate(ViewLocator.View("About")); }
public void Search(object arg) { NavigationService.Navigate(ViewLocator.View("Search")); }
public void ListMap(object arg) { NavigationService.Navigate(ViewLocator.View("ListMap")); }
public void Favorites(object arg) { NavigationService.Navigate(ViewLocator.View("Favorites")); }
public void Record(object arg) { NavigationService.Navigate(ViewLocator.View("Record")); }