"LoadPreset" on Windows11 theme results in invisible controls

1 Answer 61 Views
Styling
Heiko
Top achievements
Rank 1
Iron
Veteran
Heiko asked on 26 Jul 2024, 01:15 PM

Package: Telerik.UI.for.Wpf.70, Version=2024.2.514

I include all necessary theme files for Windows 11 theme in App.xaml:

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows11;component/Themes/System.Windows.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows11;component/Themes/Telerik.Windows.Controls.xaml"/>
                ...
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>

I place a simple Button and RadButton inside MainWindow.xaml. When running in this configuration the buttons are visible, the correct theme is assigned. (see screenshot 1)

When placing Windows11Palette.LoadPreset(Windows11Palette.ColorVariation.Dark); inside OnStartup of Application the buttons disappear during runtime. (see screenshot 2)

What am I missing here? The same is with Fluent theme. Other themes like Office2019 work perfectly.

TIA
Heiko

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 30 Jul 2024, 07:58 AM

Hello Heiko,

The buttons disappear because they are designed for dark backgrounds. Actually, they are not missing, but their background and foreground becomes very light, which doesn't work on white backgrounds. In general, the Dark color variations of the Telerik themes are created to look good on black or other dark backgrounds. You can see the controls in the Dark variation of some themes (aside from Windows 11), but they usually don't look very good on white backgrounds.

To get the desired effect, you should ensure that the background behind the button is dark.

If the buttons are still not visible, then you can check the following articles:

I hope that helps.

Regards,
Martin Ivanov
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.

Tags
Styling
Asked by
Heiko
Top achievements
Rank 1
Iron
Veteran
Answers by
Martin Ivanov
Telerik team
Share this question
or