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

more than one theme

5 Answers 23 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rayne
Top achievements
Rank 1
Rayne asked on 23 Apr 2014, 08:07 PM
I'm just now getting around to doing some maintenance on an existing project and it required upgrading all the Telerik libraries. 

So now, I've got both UI for WPF plus Reporting up to the latest versions, and I've learned that the Report Viewer requires implicit styling. Right now it's coming up blank.

So what now? If I follow the instructions on how to get the Report Viewer working, it means replacing my dlls with the NoXaml versions. This will obviously mess with the rest of my application, won't it? So then I would have to change the entire app to use implicit styling.

But currently I'm using more than one theme by setting the Application Theme as well as overriding various controls throughout the app to use a different theme. If I go implicit styling, then I'm merging the xaml files from a specific theme. Won't I lose the ability to override certain controls to a different theme?

I'm a bit confused on how this all works?

5 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 25 Apr 2014, 01:07 PM
Hello Rayne,

Indeed, in the latest release of Reporting, the ReportViewer control supports only implicit styles and this requires migrating the whole WPF application to this approach.  Note that implicit styles is the recommended approach of styling our controls as it has some advantages over StyleManager, you could find more details in the XAML Theming – Implicit Styles versus StyleManager blog post. Furthermore, with implicit styles you will be able to change the theme at runtime without recreating the UI, the exact approach is explained in this help topic.

Can you send us more details on the issues you're experiencing with the implicit styles, so we to be able to provide more concrete instructions?

I am looking forward to your reply.

Regards,
Yana
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Rayne
Top achievements
Rank 1
answered on 25 Apr 2014, 01:15 PM
My application is using Office Blue theme. But in a few of my xaml files, I'm explicitly overriding this theme on a few select controls by adding StyleManager.Theme in the control xaml tag. Some of the RadButtons use Windows8 theme. I've got a few RadExpanders that use Transparent theme. It just blends better that way on some of my screens.

Using the implicit theming, these controls do not pick up the overridden theme. They are being styled with the implicit Office Blue theme.

How do I get just a few controls in an entire application to use a different theme?  I don't want to change the whole theme at runtime. I just need a few controls to use a different theme always.
0
Yana
Telerik team
answered on 25 Apr 2014, 02:04 PM
Hello Rayne,

Can you send us the exact list of the controls that need to have a different theme applied and which theme (except the already mentioned RadButton and RadExpander), so we could try to find a suitable solution for this scenario?

Regards,
Yana
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Rayne
Top achievements
Rank 1
answered on 25 Apr 2014, 05:53 PM
RadComboBox, RadDropDownList, ScrollViewer and Button

I think the standard controls kept the explicit styling. It was just the Rad controls that I had a problem with.

0
Masha
Telerik team
answered on 29 Apr 2014, 06:28 AM
Hello,

The easiest way to make some controls to have different theme is to merge  needed resource dictionaries into the scope of the desired control. For example
<telerik:RadComboBox VerticalAlignment="Center" Style="{DynamicResource RadComboBoxStyle}" Margin="10">
       <telerik:RadComboBox.Resources>
         <ResourceDictionary>
           <ResourceDictionary.MergedDictionaries>
             <ResourceDictionary Source="/Telerik.Windows.Themes.Transparent;component/Themes/System.Windows.xaml"/>
             <ResourceDictionary Source="/Telerik.Windows.Themes.Transparent;component/Themes/Telerik.Windows.Controls.xaml"/>
             <ResourceDictionary Source="/Telerik.Windows.Themes.Transparent;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
           </ResourceDictionary.MergedDictionaries>
         </ResourceDictionary>
       </telerik:RadComboBox.Resources>
       <telerik:RadComboBoxItem>Item 1</telerik:RadComboBoxItem>
       <telerik:RadComboBoxItem>Item 2</telerik:RadComboBoxItem>
       <telerik:RadComboBoxItem>Item 3</telerik:RadComboBoxItem>
       <telerik:RadComboBoxItem>Item 4</telerik:RadComboBoxItem>
     </telerik:RadComboBox>

For small our controls you can create separate resource dictionaries where needed Telerik resource dictionaries  are merged and merge this file into the scope of the control.

You can find attached a sample demo demonstrating this approach.

Regards,
Masha
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
General Discussions
Asked by
Rayne
Top achievements
Rank 1
Answers by
Yana
Telerik team
Rayne
Top achievements
Rank 1
Masha
Telerik team
Share this question
or