This is a migrated thread and some comments may be shown as answers.

Exclude certain themes when building Telerik RadControls for WPF Source

10 Answers 199 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 27 Nov 2013, 12:57 AM
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

10 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 02 Dec 2013, 11:13 AM
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 >>
0
Steven
Top achievements
Rank 1
answered on 05 Dec 2013, 01:27 AM
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
0
Vanya Pavlova
Telerik team
answered on 05 Dec 2013, 08:50 AM
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 >>
0
Steven
Top achievements
Rank 1
answered on 05 Dec 2013, 11:24 PM
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>
0
Vanya Pavlova
Telerik team
answered on 06 Dec 2013, 08:20 AM
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 >>
0
Steven
Top achievements
Rank 1
answered on 08 Dec 2013, 10:49 PM
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
0
Vanya Pavlova
Telerik team
answered on 09 Dec 2013, 08:00 AM
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 >>
0
Steven
Top achievements
Rank 1
answered on 09 Dec 2013, 11:06 PM
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.
0
Vanya Pavlova
Telerik team
answered on 10 Dec 2013, 08:41 AM
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 >>
0
Steven
Top achievements
Rank 1
answered on 11 Dec 2013, 10:59 PM
Thanks Vanya. You guys' support is super. Thumps up.
Tags
General Discussions
Asked by
Steven
Top achievements
Rank 1
Answers by
Yana
Telerik team
Steven
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or