From a735e5096553e0f84d2596a024334cfad7d38866 Mon Sep 17 00:00:00 2001 From: Marcel Wagner Date: Tue, 17 Oct 2023 00:55:19 +0200 Subject: [PATCH] Rename NewControls page to Homepage (#1381) ## Description Renames the NewControls page to HomePage since the menu item is called "Home" and showing new control samples is no longer its only purpose. ## Motivation and Context Part of #1279 ## How Has This Been Tested? ## Screenshots (if appropriate): ## Types of changes - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) --- WinUIGallery/App.xaml.cs | 8 ++++---- .../ControlPages/CreateMultipleWindowsPage.xaml.cs | 2 +- .../ControlPagesSampleCode/Window/CreateWindowSample1.txt | 2 +- WinUIGallery/{NewControlsPage.xaml => HomePage.xaml} | 2 +- .../{NewControlsPage.xaml.cs => HomePage.xaml.cs} | 4 ++-- WinUIGallery/Navigation/NavigationRootPage.xaml.cs | 4 ++-- WinUIGallery/Strings/en-US/Resources.resw | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) rename WinUIGallery/{NewControlsPage.xaml => HomePage.xaml} (99%) rename WinUIGallery/{NewControlsPage.xaml.cs => HomePage.xaml.cs} (96%) diff --git a/WinUIGallery/App.xaml.cs b/WinUIGallery/App.xaml.cs index e1c67d2a1..8262f2017 100644 --- a/WinUIGallery/App.xaml.cs +++ b/WinUIGallery/App.xaml.cs @@ -148,7 +148,7 @@ private async void EnsureWindow(IActivatedEventArgs args = null) ThemeHelper.Initialize(); - Type targetPageType = typeof(NewControlsPage); + Type targetPageType = typeof(HomePage); string targetPageArguments = string.Empty; if (args != null) @@ -184,9 +184,9 @@ private async void EnsureWindow(IActivatedEventArgs args = null) { targetPageType = typeof(AllControlsPage); } - else if (targetId == "NewControls") + else if (targetId == "HomePage") { - targetPageType = typeof(NewControlsPage); + targetPageType = typeof(HomePage); } else if (ControlInfoDataSource.Instance.Groups.Any(g => g.UniqueId == targetId)) { @@ -216,7 +216,7 @@ bool IsMatching(string parent, string expression) NavigationRootPage rootPage = StartupWindow.Content as NavigationRootPage; rootPage.Navigate(targetPageType, targetPageArguments); - if (targetPageType == typeof(NewControlsPage)) + if (targetPageType == typeof(HomePage)) { ((Microsoft.UI.Xaml.Controls.NavigationViewItem)((NavigationRootPage)App.StartupWindow.Content).NavigationView.MenuItems[0]).IsSelected = true; } diff --git a/WinUIGallery/ControlPages/CreateMultipleWindowsPage.xaml.cs b/WinUIGallery/ControlPages/CreateMultipleWindowsPage.xaml.cs index 1e24dec4c..616732cce 100644 --- a/WinUIGallery/ControlPages/CreateMultipleWindowsPage.xaml.cs +++ b/WinUIGallery/ControlPages/CreateMultipleWindowsPage.xaml.cs @@ -31,7 +31,7 @@ private void createNewWindow_Click(object sender, RoutedEventArgs e) newWindow.Content = rootPage; newWindow.Activate(); - var targetPageType = typeof(NewControlsPage); + var targetPageType = typeof(HomePage); string targetPageArguments = string.Empty; rootPage.Navigate(targetPageType, targetPageArguments); } diff --git a/WinUIGallery/ControlPagesSampleCode/Window/CreateWindowSample1.txt b/WinUIGallery/ControlPagesSampleCode/Window/CreateWindowSample1.txt index 7f5890faf..938d39d2f 100644 --- a/WinUIGallery/ControlPagesSampleCode/Window/CreateWindowSample1.txt +++ b/WinUIGallery/ControlPagesSampleCode/Window/CreateWindowSample1.txt @@ -6,6 +6,6 @@ newWindow.Content = rootPage; newWindow.Activate(); // C# code to navigate in the new window -var targetPageType = typeof(NewControlsPage); +var targetPageType = typeof(HomePage); string targetPageArguments = string.Empty; rootPage.Navigate(targetPageType, targetPageArguments); \ No newline at end of file diff --git a/WinUIGallery/NewControlsPage.xaml b/WinUIGallery/HomePage.xaml similarity index 99% rename from WinUIGallery/NewControlsPage.xaml rename to WinUIGallery/HomePage.xaml index 191f39ea4..89c0d08de 100644 --- a/WinUIGallery/NewControlsPage.xaml +++ b/WinUIGallery/HomePage.xaml @@ -10,7 +10,7 @@ //********************************************************* --> Enter ZIP code - + What's New - + What's New \ No newline at end of file