From 32cc6d3cc723ff98a405bd0ad401f4466c1e3bb3 Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Tue, 19 Nov 2024 15:17:28 +0100 Subject: [PATCH] chore: Apply suggestions from code review Co-authored-by: Ramez Ragaa <66218781+ramezgerges@users.noreply.github.com> --- doc/articles/controls/Frame.md | 2 +- src/Uno.UI/UI/Xaml/Controls/Frame/Frame.partial.mux.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/articles/controls/Frame.md b/doc/articles/controls/Frame.md index 66fbb354bc15..b96205186e02 100644 --- a/doc/articles/controls/Frame.md +++ b/doc/articles/controls/Frame.md @@ -11,7 +11,7 @@ uid: Uno.Controls.Frame ## Using Frame with Uno -To improve performance during navigation, `Frame` on Android, iOS, and WebAssembly targets operates in different way than in WinUI. Whereas WinUI follows `NavigationCacheMode` property on individual `Page` instances, on iOS and Android we keep the individual page instances in the back stack in memory by default. This way the can be quickly surfaced back to the user during back navigation. This behavior can be controlled using the `FeatureConfiguration.Frame.UseWinUIBehavior` property. This defaults to `true` on Skia targets and to `false` on Android, iOS and WebAssembly. +To improve performance during navigation, `Frame` on Android, iOS, and WebAssembly targets operates in different way than in WinUI. Whereas WinUI follows `NavigationCacheMode` property on individual `Page` instances, on iOS and Android we keep the individual page instances in the back stack in memory by default. This way they can be quickly surfaced back to the user during back navigation. This behavior can be controlled using the `FeatureConfiguration.Frame.UseWinUIBehavior` property. This defaults to `true` on Skia targets and to `false` on Android, iOS and WebAssembly. If you set `UseWinUIBehavior` to `true` on Android and iOS, you also need to override the default style for the control. You can do this by explicitly setting the `Style` to `XamlDefaultFrame`: diff --git a/src/Uno.UI/UI/Xaml/Controls/Frame/Frame.partial.mux.cs b/src/Uno.UI/UI/Xaml/Controls/Frame/Frame.partial.mux.cs index c30c39b88a0d..17939d179210 100644 --- a/src/Uno.UI/UI/Xaml/Controls/Frame/Frame.partial.mux.cs +++ b/src/Uno.UI/UI/Xaml/Controls/Frame/Frame.partial.mux.cs @@ -50,7 +50,7 @@ protected override void OnApplyTemplate() base.OnApplyTemplate(); #if HAS_UNO - if (this.TemplatedRoot?.GetType().Name?.Contains("NativeFramePresenter", StringComparison.Ordinal) == true) + if (_useWinUIBehavior && this.TemplatedRoot?.GetType().Name?.Contains("NativeFramePresenter", StringComparison.Ordinal) == true) { // It is not possible to use the WinUI behavior with a NativeFramePresenter. if (this.Log().IsEnabled(LogLevel.Error))