Skip to content
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
4 changes: 4 additions & 0 deletions src/Controls/src/Core/NavigationPage/NavigationPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,10 @@ await Owner.SendHandlerUpdateAsync(animated,
{
Owner.RemoveFromInnerChildren(currentPage);
Owner.CurrentPage = newCurrentPage;
if (currentPage.TitleView != null)
{
currentPage.RemoveLogicalChild(currentPage.TitleView);
}
},
() =>
{
Expand Down
8 changes: 4 additions & 4 deletions src/Controls/src/Core/Page/Page.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public partial class Page : VisualElement, ILayout, IPageController, IElementCon
bool _hasAppeared;
private protected bool HasAppeared => _hasAppeared;

View _titleView;
internal View TitleView;

List<Action> _pendingActions = new List<Action>();

Expand Down Expand Up @@ -494,8 +494,8 @@ protected override void OnBindingContextChanged()
SetInheritedBindingContext(menubarItem, BindingContext);
}

if (_titleView != null)
SetInheritedBindingContext(_titleView, BindingContext);
if (TitleView != null)
SetInheritedBindingContext(TitleView, BindingContext);
}

/// <summary>
Expand Down Expand Up @@ -798,7 +798,7 @@ public IPlatformElementConfiguration<T, Page> On<T>() where T : IConfigPlatform

internal void SetTitleView(View oldTitleView, View newTitleView)
{
_titleView = newTitleView;
TitleView = newTitleView;
}

internal bool HasNavigatedTo { get; private set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ await CreateHandlerAndAddToWindow<WindowHandlerStub>(new Window(navPage), async
new RadioButton(),
}
};
NavigationPage.SetTitleView(page, new Label() { Text = "Title View" });
pageReference = new WeakReference(page);
await navPage.Navigation.PushAsync(page);
await navPage.Navigation.PopAsync();
Expand Down