Skip to content

Commit

Permalink
fix: Adjust NativeFramePresenter to work with new TemplatedParent (
Browse files Browse the repository at this point in the history
…#1266)

(cherry picked from commit f704393)
  • Loading branch information
MartinZikmund authored and mergify[bot] committed Oct 15, 2024
1 parent fedf139 commit 665f94d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
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

0 comments on commit 665f94d

Please sign in to comment.