Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename NewControls page to Homepage #1381

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>