Merging theme not working correctly

2 posts, 0 answers
  1. Juraj
    Juraj avatar
    2 posts
    Member since:
    Sep 2019

    Posted 28 Nov 2019 Link to this post

    Hello,

     

    I merged themes in Application.Xaml like this

       <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.GridView.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.FixedDocumentViewers.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>

    And this is working correctly, but as soon as I merge this file (which I need for my project) every ordinary button in my project merges this Expression dark theme (which I do not want).

    <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>

     

     I am aware that merging System.Windows with this theme changes button style but in this case it is not merged, and it still looks different.

    So, two questions:

    1.) How do I merge Telerik.Windows.Controls.Navigation with this Theme without merging ordinary buttons also with this theme?

    2.) Is there any way I can merge this theme to System.Windows this but only to tooltips and scrollbars?

     

    Thank you

     

  2. Juraj
    Juraj avatar
    2 posts
    Member since:
    Sep 2019

    Posted 28 Nov 2019 Link to this post

    I managed to do what I wanted, here is a solution

    Application.xaml.vb

    Imports Telerik.Windows.Controls
     
    Class Application
        Public Sub New()
            StyleManager.ApplicationTheme = New Expression_DarkTheme()
            InitializeComponent()
        End Sub
    End Class

     

     

    Application.xaml

    <Application.Resources>
        <Style TargetType="ScrollBar">
            <Setter Property="telerik:StyleManager.Theme" Value="Expression_Dark"/>
        </Style>
        <Style TargetType="ToolTip">
            <Setter Property="telerik:StyleManager.Theme" Value="Expression_Dark"/>
        </Style>
    </Application.Resources>
Back to Top