-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Application styles are only applied if there is more than one style when StartupUri is not used #4457
Comments
You need to add a
|
Why is this needed if it's not needed when StartupUri is used and it's not needed if there is more than one style? |
This bug looks really weird. It's from the code generated by PresentationBuildTasks.dll. See the difference between the generated code in App.g.i.cs: Without <Style x:Key="Workaround" />
With <Style x:Key="Workaround" />
It does not seem to generate the InitializeComponent when there is only one item in My guess would be that there is a wrong condition here that prevents the generation of InitializeComponent: |
…hen App contains a single item. Fixes dotnet#4538 Fixes dotnet#4457 Fixes dotnet#2926 Fixes dotnet#2543 Fixes dotnet#6198
This bug should be fixed by #8853. For now, you can workaround this issue by adding a dummy item in |
The application style has no effect, but it should have an effect. The style starts taking effect as soon as a second unrelated style is added before or after it.
This causes a long search for ways to fix the problem and is not beginner-friendly.
Full repro created from VS template
Download: Repro.zip
The text was updated successfully, but these errors were encountered: