Skip to content

Commit

Permalink
Merge pull request #1267 from unoplatform/mergify/bp/release/stable/6…
Browse files Browse the repository at this point in the history
….3/pr-1266

fix: Adjust `NativeFramePresenter` to work with new `TemplatedParent` (backport #1266)
  • Loading branch information
jeromelaban authored Oct 15, 2024
2 parents fedf139 + 665f94d commit b83c0bc
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 b83c0bc

Please sign in to comment.