Using multiple Windows8 themes

2 posts, 0 answers
  1. Richard
    Richard avatar
    1 posts
    Member since:
    Mar 2013

    Posted 15 Aug 2013 Link to this post

    Hi,

    I'm working on a WPF 4.0 app which uses the Windows 8 theme with a predominantly green colour scheme. However some parts of the app use a grey colour scheme and this is causing me issues, specifically with RadComboBox.

    I've set the colours in Windows8Palette.Palette according to the green colour scheme and that all works fine. My problem comes when I need to use a RadComboBox with the grey colour scheme. I have styles for RadComboBox which set Background, Foreground etc. to the appropriate grey colour scheme colours and I've set the combo box's ItemContainerStyle to one which styles a RadComboBoxItem with the correct colours but some parts of the RadComboBox UI access Windows8Resource directly which gives them the green colour scheme rather than the grey one I want.

    For example, in Telerik.Windows.Controls.Input.xaml (for the Windows 8 theme), the style for RadComboBoxItem gives the control a Border called HighlightVisual which is made visible on mouse over. This control sets its Background to "{telerik:Windows8Resource ResourceKey=BasicBrush}" and I haven't been able to figure out a way to set this to a colour from the grey scheme without changing BasicBrush for the whole app.

    Is there a way to change this colour for a single control, preferably in a Style?

    I could create Styles which duplicate the XAML for RadComboBoxItem etc. and then set the Background to something different but this seems like a lot of effort just to change the Background of a Border!

    Cheers,

    Richard
  2. Masha
    Admin
    Masha avatar
    355 posts

    Posted 19 Aug 2013 Link to this post

    Hello Richard,

    There is no way to change the color for a single control when you modify colors using Windows8Palette.

    I can suggest edit the control template of the RadComboBox. You can do that by using implicit styles. Here is a very descriptive article on the topic.

    I hope it helps.

    Regards,
    Masha
    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
Back to Top