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

fix: Adjust NativeFramePresenter to work with new TemplatedParent #1266

Merged
merged 1 commit into from
Oct 14, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ public partial class NativeFramePresenter : Grid // Inheriting from Grid is a ha
public NativeFramePresenter()
{
_pageStack = this;

this.Loaded += OnLoaded;
}

protected override void OnTemplatedParentChanged(DependencyPropertyChangedEventArgs e)
private void OnLoaded(object sender, RoutedEventArgs e)
{
base.OnTemplatedParentChanged(e);
Initialize(TemplatedParent as Frame);
Initialize(this.FindFirstParent<Frame>());
}

private void Initialize(Frame? frame)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ public NativeFramePresenter()
SizeChanged += NativeFramePresenter_SizeChanged;
// Hide the NavigationBar by default. Only show if navigating to a Page that contains a NavigationBar.
NavigationController.NavigationBarHidden = true;
this.Loaded += OnLoaded;
}

protected override void OnTemplatedParentChanged(DependencyPropertyChangedEventArgs e)
private void OnLoaded(object sender, RoutedEventArgs e)
{
base.OnTemplatedParentChanged(e);
InitializeController(TemplatedParent as Frame);
InitializeController(this.FindFirstParent<Frame>());
}

/// <summary>
Expand Down
Loading