Declined
Last Updated: 26 Oct 2023 16:10 by ADMIN
Patrick
Created on: 21 Jul 2023 08:23
Category: UI for WPF
Type: Bug Report
0
Theme color variation doesn't apply at design time in Visual Studio 2022
Theme color variation does not get applied in the XAML designer in Visual Studio 2022.
1 comment
ADMIN
Vladimir Stoyanov
Posted on: 26 Oct 2023 16:09

We investigated this scenario and this behavior occurs when changing the theme color variation inside the static constructor of the MainWindow of the application. Unfortunately, the static constructor of the MainWindow is not invoked during design time. You can find some more information about that in the following threads: WPF designer doesn't run window static constructor upon starting up and Why isn't my WPF control's code-behind running at design time?.

As a workaround, a UserControl can be created and placed as the first child of the MainWindow and the color variation change can happen inside the static constructor of the UserControl. You can find a sample project demonstrating this approach attached to this reply. 

Regards,
Vladimir Stoyanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Attached Files: