Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Fixed Title not updating on parent page (#743)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmgarrido authored and rmarinho committed Feb 17, 2017
1 parent 53b1bba commit f449b31
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
@@ -0,0 +1,43 @@
using System;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif

namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 43527, "[UWP] Detail title does not update when wrapped in a NavigationPage", PlatformAffected.WinRT)]
public class Bugzilla43527 : TestMasterDetailPage
{
protected override void Init()
{
Master = new ContentPage
{
Title = "Master",
BackgroundColor = Color.Red
};

Detail = new NavigationPage(new TestPage());
}

class TestPage : ContentPage
{
public TestPage()
{
Title = "Test Page";

Content = new StackLayout
{
Children = {
new Label { Text = "Hello Page" },
new Button { Text = "Change Title", Command = new Command(() => Title = $"New Title: {DateTime.Now.Second}") }
}
};
}
}
}
}
Expand Up @@ -144,6 +144,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43313.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43469.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43516.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43527.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla44047.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43941.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43663.cs" />
Expand Down
2 changes: 2 additions & 0 deletions Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs
Expand Up @@ -314,6 +314,8 @@ void OnCurrentPagePropertyChanged(object sender, PropertyChangedEventArgs e)
UpdateBackButtonTitle();
else if (e.PropertyName == NavigationPage.HasNavigationBarProperty.PropertyName)
UpdateTitleVisible();
else if (e.PropertyName == Page.TitleProperty.PropertyName)
UpdateTitleOnParents();
}

void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
Expand Down

0 comments on commit f449b31

Please sign in to comment.