Skip to content

How to custom ApplicationDefinition in xaml islands? #9130

Open

Description

Describe the bug

The default ApplicationDefinition corresponds to App.xaml. However, when I put both programs into appx, I had to rename their respective App.xaml to prevent compile failures. However, a strange thing happened, after the compilation was successful, it prompted that XamlControlsResources was loaded as null, and XamlControlsResources could only be loaded successfully if the name of ApplicationDefinition was App.xaml.
默认的ApplicationDefinition对应的是App.xaml。然而,当我有两个程序都放入appx中时,就不得不需要重新指定各自App.xaml的名称,以防止编译时出现失败。然而,诡异的事情发生了,编译成功后运行,却提示XamlControlsResources加载为null,只有ApplicationDefinition的名称为App.xaml时,XamlControlsResources才能加载成功。
另一种方案是直接不定义ApplicationDefinition,编译时提示WMC9999,Object reference not set to an instance of an object.
The other solution is to directly not define the ApplicationDefinition, and the compilation time prompts WMC9999, Object reference not set to an instance of an object.
想问一下这种bug该如何解决?
How to solve this kind of bug?

At present, I have tested on Winui3, you can modify App.xaml to other names or undefine ApplicationDefinition, and the compilation can be directly passed, so how to implement it in Xaml islands?
目前我在Winui3上测试过,可以修改App.xaml为其他名称或者取消定义ApplicationDefinition,编译能直接通过,那么如何在Xaml islands中实现呢?

Steps to reproduce the bug

None

Expected behavior

The program can run with a custom App name or without a ApplicationDefinition

Screenshots

None

NuGet package version

WinUI 2 - Microsoft.UI.Xaml 2.8.2

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions