Skip to content

Commit

Permalink
Rename NewControls page to Homepage (microsoft#1381)
Browse files Browse the repository at this point in the history
<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->
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
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
Part of microsoft#1279

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] 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)
  • Loading branch information
marcelwgn authored Oct 16, 2023
1 parent cd00c13 commit a735e50
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions WinUIGallery/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//*********************************************************
-->
<local:ItemsPageBase
x:Class="AppUIBasics.NewControlsPage"
x:Class="AppUIBasics.HomePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:AppUIBasics.Controls"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

namespace AppUIBasics
{
public sealed partial class NewControlsPage : ItemsPageBase
public sealed partial class HomePage : ItemsPageBase
{
public NewControlsPage()
public HomePage()
{
this.InitializeComponent();
}
Expand Down
4 changes: 2 additions & 2 deletions WinUIGallery/Navigation/NavigationRootPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ private void OnNavigationViewSelectionChanged(NavigationView sender, NavigationV
}
else if (selectedItem == Home)
{
if (rootFrame.CurrentSourcePageType != typeof(NewControlsPage))
if (rootFrame.CurrentSourcePageType != typeof(HomePage))
{
Navigate(typeof(NewControlsPage));
Navigate(typeof(HomePage));
}
}
else if (selectedItem == DesignGuidanceItem || selectedItem == AccessibilityItem)
Expand Down
4 changes: 2 additions & 2 deletions WinUIGallery/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@
<data name="InputValidationPage_ZipCodeField.PlaceholderText" xml:space="preserve">
<value>Enter ZIP code</value>
</data>
<data name="NewControlsPage_PageHeader.Title" xml:space="preserve">
<data name="HomePage_PageHeader.Title" xml:space="preserve">
<value>What's New</value>
</data>
<data name="NewControlsPage_SmallHeader.Text" xml:space="preserve">
<data name="HomePage_SmallHeader.Text" xml:space="preserve">
<value>What's New</value>
</data>
</root>

0 comments on commit a735e50

Please sign in to comment.