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

Frame content does not render when using FeatureConfiguration.Frame.UseWinUIBehavior on android #18401

Open
DavidM29 opened this issue Oct 7, 2024 · 1 comment · May be fixed by #18460
Open
Assignees
Labels
area/porting 🖨️ Categorizes an issue or PR as relevant for porting of WinUI code difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working

Comments

@DavidM29
Copy link

DavidM29 commented Oct 7, 2024

Current behavior

Frame content does not render when setting FeatureConfiguration.Frame.UseWinUIBehavior = true;.

Expected behavior

Content should get rendered.

How to reproduce it (as minimally and precisely as possible)

  • Run the attached app on android with FeatureConfiguration.Frame.UseWinUIBehavior = true;, Test Button is not visible.
  • Run without FeatureConfiguration.Frame.UseWinUIBehavior = true; and the Test Button is visible.

UnoApp1.zip

Workaround

Have not found any workarounds yet.

Works on UWP/WinUI

Yes

Environment

No response

NuGet package version(s)

No response

Affected platforms

Android

IDE

Visual Studio 2022

IDE version

17.11.4

Relevant plugins

No response

Anything else we need to know?

No response

@DavidM29 DavidM29 added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Oct 7, 2024
@MartinZikmund MartinZikmund self-assigned this Oct 7, 2024
@MartinZikmund MartinZikmund added area/porting 🖨️ Categorizes an issue or PR as relevant for porting of WinUI code difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Oct 7, 2024
@MartinZikmund
Copy link
Member

After investigation I have found out the problem is that Uno.Toolkit automatically applies the NativeFramePresenter as the Frame template. This does not fare well with the WinUI Frame behavior, as that requires the Frame to manage Page instances and caching as compared to the frame presenter itself.

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:

<Frame Style="{StaticResource XamlDefaultFrame}" />

Or by creating an implicit style based on XamlDefaultFrame:

<Style TargetType="Frame" BasedOn="XamlDefaultFrame" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/porting 🖨️ Categorizes an issue or PR as relevant for porting of WinUI code difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants