Exclude certain themes when building Telerik RadControls for WPF Source

11 posts, 0 answers
  1. Steven
    Steven avatar
    7 posts
    Member since:
    Dec 2011

    Posted 26 Nov 2013 Link to this post

    Hi guys,

    How can I modify the source code of "Telerik RadControls for WPF" to exclude unwanted themes? Do you guys have any instruction for this? Thanks a lot in advance.

    At the moment, my application use 3 themes: summer, Office_Black & Windows7. I would like to remove all other themes to reduce the size. The following are the dlls I'm using. They come with all themes embedded.
    • Telerik.Windows.Control.dll
    • Telerik.Windows.Control.Input.dll
    • Telerik.Windows.Control.Navigation.dll
    • Telerik.Windows.Data.dll

    Using noxaml dlls is not an option for me since my app also has WPF Telerik Report viewer (which according to Telerik won't work with noxaml dlls). By the way, I already downloaded the source code & built it successfully using the predefined .bat file.

    Thanks,
    Steve
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 02 Dec 2013 Link to this post

    Hi Steve,

    I am afraid that at the moment there is no way to exclude certain themes from the Telerik WPF assemblies.  We already have logged the request for using ReportViewer with NoXaml assemblies and it will be added in some of the future versions of the control.

    We're sorry for any inconvenience caused.

    Regards,
    Yana
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Steven
    Steven avatar
    7 posts
    Member since:
    Dec 2011

    Posted 04 Dec 2013 Link to this post

    Hi Telerik team,

    Thanks a lot for your reply. I have another question regarding noxaml dll.

    At the moment, Telerik silverlight themes are located in separate assemblies. In a silverlight app, I can just reference the specific theme dll(s) that I need. Is there any plan for similar thing in WPF?

    Let say my app use Windows7 theme for a button, but Summer theme for the toolbar, and Summer theme for a different button. In silverlight, I can reference just Windows7 & Summer themes, then explicitly tell the controls to use the theme they need. As far as I know, I can't do the same thing in WPF. In WPF, i need to use noxaml dlls, and set the theme implicitly. This make it really messy since the app uses 2 themes (not 1).

    Cheers,
    Steve
  5. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 05 Dec 2013 Link to this post

    Hi Steven,


    Thank you for getting back to us! We ship theme projects under Themes and Themes.Implicit folders,
    which are intended to use with standard and NoXAML binaries.
    These projects are valid for both WPF/Silverlight platforms. Under Binaries.NoXAML folder for WPF you have assemblies for all themes, which you can use in the same manner as those for Silverlight.
    You may check the following threads for further reference:

                                                         "Difference implicit/non-implicit themes"
                                                                    "WPF Binaries.NoXaml"
     

    Regards,
    Vanya Pavlova
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Steven
    Steven avatar
    7 posts
    Member since:
    Dec 2011

    Posted 05 Dec 2013 Link to this post

    I have a simple test project below. I reference the noxaml "Telerik.Windows.Controls.dll" and "Telerik.Windows.Themes.Windows7.dll".
    The Telerik RadButton doesn't show up when I run this test app. Please note I don't want to use implicit styling.
    Can you please show me how to get the Telerik RadButton to show up properly?

    Many thanks.

    <Window x:Class="TestTelerikTheme.MainWindow"
            xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
            Title="MainWindow" Height="350" Width="525">
      <Grid>
        <Grid.RowDefinitions>
          <RowDefinition/>
          <RowDefinition/>
        </Grid.RowDefinitions>
      
        <telerik:RadButton Content="Telerik Button" telerik:StyleManager.Theme="Windows7"/>
      
        <Button Content=".Net Button" Grid.Row="1"/>
      
      </Grid>
    </Window>
  7. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 06 Dec 2013 Link to this post

    Hi Steven,


    Thank you for getting back to us! When you are using standard binaries you do not have to reference Telerik.Windows.Themes.Windows7.dll unless you are defining custom theme based on Windows7 using StyleManager.  The themes and their resources are contained in the assembly so you need to reference only "Telerik.Windows.Controls.dll" and set the theme to the button. 
    You may check the attached project for further reference.  



    Regards,
    Vanya Pavlova
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  8. Steven
    Steven avatar
    7 posts
    Member since:
    Dec 2011

    Posted 08 Dec 2013 Link to this post

    Hi Vanya,

    Many thanks for your quick reply.

    I want to use noxaml wpf dll (not standard dll). I think i did state that in my previous post (sorry probably should bold that in previous post to make it more obvious). This is for a different app which does not need Telerik Report Viewer.

    To sum it up, the app needs noxaml dll, Windows7 theme & possibly Summer theme; and I can't set the theme application wide. Is there a way to set the theme explicitly to individual telerik control?

    Thanks,
    Steve
  9. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 09 Dec 2013 Link to this post

    Hi Steven,


    Thank you for getting back to us! Actually NoXAML dlls reply on implicit styling approach. All implicit styles for the corresponding theme will be applied globally to all controls. If you want to override simple properties of an element you may  define simple style targeted at the corresponding element and use the BasedOn attribute to set these properties, which will override those defined by the parent style.  
    However I am not quite sure what do you mean by: "Is there a way to set the theme explicitly to individual telerik control?"  when we are talking about implicit styling approach.  Would it be possible to clarify a bit? 
    Since you are using  Windows7 and Summer themes, you may switch it at runtime, as described in our documentation.   



    Regards,
    Vanya Pavlova
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  10. Steven
    Steven avatar
    7 posts
    Member since:
    Dec 2011

    Posted 09 Dec 2013 Link to this post

    Thanks a lot Vanya.

    That's my problem. I want to use noxaml dll to reduce the size, but I don't want to use implicit styling. I don't want to set the theme globally to all controls. I just want to set the theme specifically to a few telerik controls only.

    I have searched telerik forum quite many times before posting this thread and couldn't find a solution. It looks like Telerik doesn't support this so never mind.

    Thanks again.
  11. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 10 Dec 2013 Link to this post

    Hello Steven,


    Thank you for getting back to us!
    Implicit styling is the most natural way to style components and styles have a scope.  
    I can confirm that this is platform specific, not Telerik related. If you want to use Windows7 theme as main theme in your application you may merge the desired Resource Dictionaries in App.xaml so they will be applied application wide. Let's say that you want to override Windows7 theme specific properties of a component only for a single RadGridView.

    You may add to the resource collection of RadGridView for Summer theme, as follows:

    <Grid DataContext="{Binding Source={StaticResource SampleDataSource}}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
            <telerik:RadGridView ItemsSource="{Binding Collection}"/>
            <telerik:RadGridView Grid.Column="1" ItemsSource="{Binding Collection}">
                <telerik:RadGridView.Resources>
                        <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Summer;component/Themes/System.Windows.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Summer;component/Themes/Telerik.Windows.Controls.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Summer;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Summer;component/Themes/Telerik.Windows.Controls.GridView.xaml"/>               
        </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
                    </telerik:RadGridView.Resources>
            </telerik:RadGridView>
        </Grid>

    This means that the implicit styles for Summer theme will be applied only in the scope of the second to RadGridView, where they are already merged.  


    I am attaching you small sample application, which you can use for further reference.  


    You may also check the following blog post, which could be interested for you on that matter. 


    Regards,
    Vanya Pavlova
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  12. Steven
    Steven avatar
    7 posts
    Member since:
    Dec 2011

    Posted 11 Dec 2013 Link to this post

    Thanks Vanya. You guys' support is super. Thumps up.
Back to Top
UI for WPF is Visual Studio 2017 Ready