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

Don't allow mixing WinUI Frame behavior with native frame presenter #18460

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MartinZikmund
Copy link
Member

@MartinZikmund MartinZikmund commented Oct 14, 2024

GitHub Issue (If applicable): closes #18401

PR Type

What kind of change does this PR introduce?

  • Feature
  • Documentation

What is the current behavior?

When WinUI Frame behavior is used, content does not load correctly.

What is the new behavior?

Error log informs the user the mode is not compatible with NativeFramePresenter - using GetType().Name to handle both the internal NativeFramePresenter as well as the one coming from Uno.Toolkit.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

// It is not possible to use the WinUI behavior with a NativeFramePresenter.
if (this.Log().IsEnabled(LogLevel.Error))
{
this.Log().LogError("WinUI Frame behavior is not compatible with NativeFramePresenter. Set the Frame.Style to '{StaticResource XamlDefaultFrame}' instead.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we perhaps "undo" the feature flags for NatveFramePresenter if UseWinUIBehavior for Frame is set?

https://github.com/unoplatform/uno/blob/4babcb40873138e6108b387d4732506c02c26824/src/Uno.UI/FeatureConfiguration.cs#L470C23-L470C53

Copy link
Member Author

@MartinZikmund MartinZikmund Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trouble here is that in case of the Toolkit NativeFramePresenter I don't think they are set - the style coming from toolkit is set always irrespective of the flags, unless I missed something. If that is the case, then I think this solution will apply to both cases.

Secondly, you could mix WinUI and non-WinUI behavior frames in a single app (not sure why though 😀), in which case this hint may be better.

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-18460/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-18460/index.html

@MartinZikmund MartinZikmund self-assigned this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Frame content does not render when using FeatureConfiguration.Frame.UseWinUIBehavior on android
4 participants