What's the correct way to customize a style when using Theme Manager/XAML binaries

1 Answer 40 Views
Styling
Joe
Top achievements
Rank 1
Iron
Veteran
Iron
Joe asked on 30 Jul 2021, 10:28 PM

My app uses the XAML binaries and the theme manager to set the application wide theme to Windows8Touch.  I also set custom palette colors at the same time. 

But whenever I want to customize a Telerik style, it seems I have to copy all of the relevant Theme XAML out of the Telerik Theme folder, replicate it in my app, and then base my styles off of that.  That's the only way that seems to work.

Because whenever  I try to base my custom style off just the type default, like this:

    <Style TargetType="{x:Type tk:RadPathButton}" BasedOn="{StaticResource {x:Type tk:RadPathButton}}">

I get weird results.  Colors don't match my the ones I set at application start times and it looks like the XAML comes from a different theme sometimes.

Is the rule that I must copy Telerik XAML in this situation or am I doing something else wrong?

1 Answer, 1 is accepted

Sort by
0
Psyduck
Top achievements
Rank 4
Bronze
Bronze
Bronze
answered on 03 Aug 2021, 08:25 AM

Hello.

 

This is a document about changing telerik xaml style. You may find it helpful.

https://docs.telerik.com/devtools/wpf/styling-and-appearance/stylemanager/common-styling-apperance-setting-theme-wpf#setting-instance-specific-built-in-theme-in-xaml


For default controls, you need to manually style the theme.
<Window.Resources> 
    <telerik:Expression_DarkTheme x:Key="Theme" /> 
    <Style TargetType="Button"> 
        <Setter Property="telerik:StyleManager.Theme" Value="{StaticResource Theme}"/> 
    </Style> 
</Window.Resources> 

Tags
Styling
Asked by
Joe
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Psyduck
Top achievements
Rank 4
Bronze
Bronze
Bronze
Share this question
or