// Handle frame switching and UI changes private void SwitchToSelectedSettings(string itemName) { App.LogService.Write("Switching to selected settings: " + itemName); if (!SettingsPages.ContainsKey(itemName)) { return; } Type itemType = SettingsPages[itemName]; if (itemType != null) { App.TelemetryService.WriteEvent(itemType.Name + "Navigate"); } if (SettingsContentFrame.CurrentSourcePageType != itemType) { _currentPageName = itemName; SettingsChoice.SelectedItem = itemName; } _previousPageName = itemName; SettingsContentFrame.Navigate(itemType, this); }
public Settings() { this.InitializeComponent(); var CoreTitleBar = CoreApplication.GetCurrentView().TitleBar; CoreTitleBar.ExtendViewIntoTitleBar = true; Window.Current.SetTitleBar(DragArea); SettingsContentFrame.Navigate(typeof(Personalization)); }
private void SettingsPane_SelectionChanged(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewSelectionChangedEventArgs args) { _ = SettingsPane.MenuItems.IndexOf(SettingsPane.SelectedItem) switch { 0 => SettingsContentFrame.Navigate(typeof(Appearance)), 1 => SettingsContentFrame.Navigate(typeof(OnStartup)), 2 => SettingsContentFrame.Navigate(typeof(Preferences)), 3 => SettingsContentFrame.Navigate(typeof(FilesAndFolders)), 4 => SettingsContentFrame.Navigate(typeof(Experimental)), 5 => SettingsContentFrame.Navigate(typeof(About)), _ => SettingsContentFrame.Navigate(typeof(Appearance)) }; }
private void SettingsPane_SelectionChanged(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewSelectionChangedEventArgs args) { var selectedItem = (Microsoft.UI.Xaml.Controls.NavigationViewItem)args.SelectedItem; int selectedItemTag = Convert.ToInt32(selectedItem.Tag); _ = selectedItemTag switch { 0 => SettingsContentFrame.Navigate(typeof(Appearance)), 1 => SettingsContentFrame.Navigate(typeof(Preferences)), 2 => SettingsContentFrame.Navigate(typeof(Multitasking)), 3 => SettingsContentFrame.Navigate(typeof(Experimental)), 4 => SettingsContentFrame.Navigate(typeof(About)), _ => SettingsContentFrame.Navigate(typeof(Appearance)) }; }
private void NavigationView_ItemInvoked(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs args) { var item = args.InvokedItemContainer.Tag; _ = SettingsPane.MenuItems.IndexOf(SettingsPane.SelectedItem) switch { 0 => SettingsContentFrame.Navigate(typeof(Appearance)), 1 => SettingsContentFrame.Navigate(typeof(OnStartup)), 2 => SettingsContentFrame.Navigate(typeof(Preferences)), 4 => SettingsContentFrame.Navigate(typeof(FilesAndFolders)), 3 => SettingsContentFrame.Navigate(typeof(StartPageWidgets)), 5 => SettingsContentFrame.Navigate(typeof(About)), _ => SettingsContentFrame.Navigate(typeof(Appearance)) }; } }
private void NavigationView_ItemInvoked(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs args) { var item = args.InvokedItemContainer.Tag; _ = args.InvokedItem.ToString() switch { "Appearance" => SettingsContentFrame.Navigate(typeof(Appearance)), "On Startup" => SettingsContentFrame.Navigate(typeof(OnStartup)), "Preferences" => SettingsContentFrame.Navigate(typeof(Preferences)), "Files and Folders" => SettingsContentFrame.Navigate(typeof(FilesAndFolders)), "Page Layouts" => SettingsContentFrame.Navigate(typeof(StartPageWidgets)), "About" => SettingsContentFrame.Navigate(typeof(About)), _ => SettingsContentFrame.Navigate(typeof(Appearance)) }; } }
private void NavigationView_ItemInvoked(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs args) { var item = args.InvokedItem; if (item.ToString() == "Personalization") { SettingsContentFrame.Navigate(typeof(Personalization)); } else if (item.ToString() == "Preferences") { SettingsContentFrame.Navigate(typeof(Preferences)); } else if (item.ToString() == "About") { SettingsContentFrame.Navigate(typeof(About)); } }
private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { foreach (ListViewItem lvi in SecondaryPane.Items) { if ((e.AddedItems[0] as ListViewItem).Name == "Personalization" && lvi.Name == "Personalization") { SettingsContentFrame.Navigate(typeof(Personalization)); } else if ((e.AddedItems[0] as ListViewItem).Name == "Preferences" && lvi.Name == "Preferences") { SettingsContentFrame.Navigate(typeof(Preferences)); } else if ((e.AddedItems[0] as ListViewItem).Name == "About" && lvi.Name == "About") { SettingsContentFrame.Navigate(typeof(About)); } } }
public Settings() { this.InitializeComponent(); var CoreTitleBar = CoreApplication.GetCurrentView().TitleBar; CoreTitleBar.ExtendViewIntoTitleBar = true; var titleBar = ApplicationView.GetForCurrentView().TitleBar; titleBar.ButtonInactiveBackgroundColor = Color.FromArgb(0, 255, 255, 255); titleBar.ButtonHoverBackgroundColor = Color.FromArgb(75, 10, 10, 10); if (App.Current.RequestedTheme == ApplicationTheme.Dark) { titleBar.ButtonBackgroundColor = Color.FromArgb(0, 0, 0, 0); titleBar.ButtonForegroundColor = Colors.White; titleBar.ButtonHoverBackgroundColor = Color.FromArgb(75, 240, 240, 240); titleBar.BackgroundColor = Color.FromArgb(255, 25, 25, 25); } else if (App.Current.RequestedTheme == ApplicationTheme.Light) { titleBar.ButtonBackgroundColor = Color.FromArgb(0, 255, 255, 255); titleBar.ButtonForegroundColor = Colors.Black; titleBar.ButtonHoverBackgroundColor = Color.FromArgb(75, 155, 155, 155); } if (this.RequestedTheme == ElementTheme.Dark) { titleBar.ButtonForegroundColor = Colors.White; titleBar.ButtonHoverBackgroundColor = Color.FromArgb(75, 240, 240, 240); titleBar.BackgroundColor = Color.FromArgb(255, 25, 25, 25); } else if (this.RequestedTheme == ElementTheme.Light) { titleBar.ButtonForegroundColor = Colors.Black; titleBar.ButtonHoverBackgroundColor = Color.FromArgb(75, 155, 155, 155); titleBar.BackgroundColor = Colors.Transparent; } SettingsContentFrame.Navigate(typeof(Appearance)); }
private void SettingsPane_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args) { if (args.IsSettingsSelected == true) { //NavView_Navigate("settings", args.RecommendedNavigationTransitionInfo); } else if (args.SelectedItemContainer != null) { var navItemTag = args.SelectedItemContainer.Tag.ToString(); if (navItemTag == "Appearance") { SettingsContentFrame.Navigate(typeof(BlankPageVid)); } if (navItemTag == "About") { SettingsContentFrame.Navigate(typeof(BlankPageAbout)); } if (navItemTag == "Files and Folders") { SettingsContentFrame.Navigate(typeof(BlankPageFilesFolders)); } } }