Skip to content

Commit

Permalink
chore: Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Ramez Ragaa <66218781+ramezgerges@users.noreply.github.com>
  • Loading branch information
MartinZikmund and ramezgerges authored Nov 19, 2024
1 parent 6c6beeb commit 32cc6d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/articles/controls/Frame.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:

Expand Down
2 changes: 1 addition & 1 deletion src/Uno.UI/UI/Xaml/Controls/Frame/Frame.partial.mux.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 32cc6d3

Please sign in to comment.