more than one theme

6 posts, 0 answers
  1. Rayne
    Rayne avatar
    241 posts
    Member since:
    Sep 2010

    Posted 23 Apr 2014 Link to this post

    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?
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 25 Apr 2014 Link to this post

    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.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Rayne
    Rayne avatar
    241 posts
    Member since:
    Sep 2010

    Posted 25 Apr 2014 in reply to Yana Link to this post

    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.
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 25 Apr 2014 Link to this post

    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.
     
  6. Rayne
    Rayne avatar
    241 posts
    Member since:
    Sep 2010

    Posted 25 Apr 2014 in reply to Yana Link to this post

    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.

  7. Masha
    Admin
    Masha avatar
    355 posts

    Posted 29 Apr 2014 Link to this post

    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.
     
Back to Top
UI for WPF is Visual Studio 2017 Ready