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

ControlTemplate.Trigger on StyleManager.Theme

1 Answer 81 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 02 Oct 2012, 11:01 PM
I'm trying to avoid a lot of custom work with themes because all I want to do is change the Header BorderBrush used on various controls.  I was hoping I could do this as in the following snippet from a RadCalendar Style in my ResourceDictionary...

<ControlTemplate TargetType="{x:Type telerik:RadCalendar}">
    <Grid>
        <!-- Standard RadCalendar Suff Omitted for brevity -->
    </Grid>
    <ControlTemplate.Triggers>
        <Trigger Property="telerik:StyleManager.Theme"
                 Value="telerik:Office_Black">
            <Setter TargetName="Navigation"
                    Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1"
                                         StartPoint="0.5,0">
                        <GradientStop Color="#FF5B5B5B"
                                      Offset="1" />
                        <GradientStop Color="#FF868686" />
                        <GradientStop Color="#FF0E0E0E"
                                      Offset="0.449" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
        </Trigger>
        <Trigger Property="telerik:StyleManager.Theme"
                 Value="telerik:Office_Blue">
            <Setter TargetName="Navigation"
                    Property="Background"
                    Value="Blue">
            </Setter>
        </Trigger>
    </ControlTemplate.Triggers>
</ControlTemplate>

And then in my xaml...

<telerik:RadDatePicker Width="300" telerik:StyleManager.Theme="{Binding TelerikTheme}" CalendarStyle="{StaticResource RadCalendarStyle1}"/>

However it doesn't work.  Is there anyway to implement something along these lines?

Thanks in advance,
Steve








1 Answer, 1 is accepted

Sort by
0
Masha
Telerik team
answered on 08 Oct 2012, 01:34 PM
Hi Steve,

We recommend using Implicit Styles when styling our controls - they allow to customize certain parts of the templates more easily.  Please find attached a sample project which illustrates how to achieve the needed approach with implicit styles

If this does not help, send us a simple runnable project which demonstrates exactly the scenario. You should open a support ticket and attach the project there.

Greetings,
Maria
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DatePicker
Asked by
Steve
Top achievements
Rank 1
Answers by
Masha
Telerik team
Share this question
or