private void frame_Navigated(object sender, NavigationEventArgs e) { if (e != null) { var vm = e.SourcePageType.ToString().Split('.').Last().Replace("Page", string.Empty); var navigationItem = PrimaryItems?.FirstOrDefault(i => i.PageIdentifier == vm); if (navigationItem == null) { navigationItem = SecondaryItems?.FirstOrDefault(i => i.PageIdentifier == vm); } if (navigationItem == null) { navigationItem = OtherItems?.FirstOrDefault(i => i.PageIdentifier == vm); } if (navigationItem != null) { changeSelected(lastSelectedItem, navigationItem); lastSelectedItem = navigationItem; Header = navigationItem.Label; } } }
private async void Frame_Navigated(object sender, NavigationEventArgs e) { if (e != null) { var vm = NavigationService.GetNameOfRegisteredPage(e.SourcePageType); var navigationItem = PrimaryItems?.FirstOrDefault(i => i.ViewModelName == vm); if (navigationItem == null) { navigationItem = SecondaryItems?.FirstOrDefault(i => i.ViewModelName == vm); } if (navigationItem != null) { ChangeSelected(_lastSelectedItem, navigationItem); _lastSelectedItem = navigationItem; } //Sentence 초기화 var init = Singleton <SentenceHelper> .Instance; //마이크로 폰 권한 체크 bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission(); if (permissionGained) { var speechLanguage = SpeechRecognizer.SystemSpeechLanguage; var langTag = speechLanguage.LanguageTag; var speechContext = ResourceContext.GetForCurrentView(); speechContext.Languages = new[] { langTag }; } } }
private void NavigationService_Navigated(object sender, NavigationEventArgs e) { if (e != null) { var vm = NavigationService.GetNameOfRegisteredPage(e.SourcePageType); ShellNavigationItem navigationItem = null; if (e.Parameter != null) { var page = e.Parameter as FBPage; navigationItem = PrimaryItems?.FirstOrDefault(i => i.ViewModelName == vm && i.Parameter == page); } else { navigationItem = PrimaryItems?.FirstOrDefault(i => i.ViewModelName == vm); if (navigationItem == null) { navigationItem = SecondaryItems?.FirstOrDefault(i => i.ViewModelName == vm); } } if (navigationItem != null) { ChangeSelected(_lastSelectedItem, navigationItem); _lastSelectedItem = navigationItem; } } }
private void NavigationService_Navigated(object sender, NavigationEventArgs e) { if (e != null) { var vm = NavigationService.GetNameOfRegisteredPage(e.SourcePageType); var navigationItem = PrimaryItems?.FirstOrDefault(i => i.ViewModelName == vm); if (navigationItem == null) { navigationItem = SecondaryItems?.FirstOrDefault(i => i.ViewModelName == vm); } if (navigationItem != null) { ChangeSelected(_lastSelectedItem, navigationItem); _lastSelectedItem = navigationItem; } if (navigationItem == null && CurrentFrameViewModel != null) { (CurrentFrameViewModel as ShellNavigationItem).IsSelected = false; } CurrentFrameViewModel = navigationItem; } }
private void Frame_Navigated(object sender, NavigationEventArgs e) { var navigationItem = PrimaryItems?.FirstOrDefault(i => i.PageType == e?.SourcePageType); if (navigationItem != null) { ChangeSelected(_lastSelectedItem, navigationItem); _lastSelectedItem = navigationItem; } }
private void Frame_Navigated(object sender, NavigationEventArgs e) { if (e != null) { var vm = NavigationService.GetNameOfRegisteredPage(e.SourcePageType); var navigationItem = PrimaryItems?.FirstOrDefault(i => i.ViewModelName == vm); if (navigationItem != null) { ChangeSelected(_lastSelectedItem, navigationItem); _lastSelectedItem = navigationItem; } } }
private void NavigationService_Navigated(object sender, NavigationEventArgs e) { var item = PrimaryItems?.FirstOrDefault(i => i.PageType == e?.SourcePageType); if (item == null) { item = SecondaryItems?.FirstOrDefault(i => i.PageType == e?.SourcePageType); } if (item != null) { ChangeSelected(_lastSelectedItem, item); _lastSelectedItem = item; } }
private void Publisher_InvokeItemEvent(object sender, Symbol itemName) { var navigationItem = PrimaryItems?.FirstOrDefault(i => i.Symbol == itemName); if (navigationItem == null) { navigationItem = SecondaryItems?.FirstOrDefault(i => i.Symbol == itemName); } if (navigationItem != null) { //ChangeSelected(_lastSelectedItem, navigationItem); //_lastSelectedItem = navigationItem; this.Navigate(navigationItem); } }
private void Frame_Navigated(object sender, NavigationEventArgs e) { if (e != null) { var vm = e.SourcePageType.FullName; var navigationItem = PrimaryItems?.FirstOrDefault(i => i.ViewModelName == vm); if (navigationItem == null) { navigationItem = SecondaryItems?.FirstOrDefault(i => i.ViewModelName == vm); } if (navigationItem != null) { ChangeSelected(_lastSelectedItem, navigationItem); _lastSelectedItem = navigationItem; } } }
private void NavigationService_Navigated(object sender, NavigationEventArgs e) { if (e != null) { var viewType = _navigationService.CurrentSourcePageType; var viewModelType = ViewModelLocator.LocateTypeForViewType(viewType, false); var navigationItem = PrimaryItems?.FirstOrDefault(i => i.ViewModelType == viewModelType); if (navigationItem == null) { navigationItem = SecondaryItems?.FirstOrDefault(i => i.ViewModelType == viewModelType); } if (navigationItem != null) { ChangeSelected(_lastSelectedItem, navigationItem); _lastSelectedItem = navigationItem; } } }