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

Style does not apply Windows8TouchTheme on RadDateTimePicker

2 Answers 92 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Roxana
Top achievements
Rank 1
Roxana asked on 12 Dec 2013, 09:25 AM


Hello Telerik,

So.. i have a RadDateTimePicker to which i want to apply Windows8TouchTheme and i want to change the content of Close Button.

To accomplish this, i've generated the style in Blend, i've searched the CloseButtonContainer and i've changed the content of Close Button and everything works perfectly.
But now, if i want to apply the theme, this is not being applied. It doesn't metter where i'm trying to apply.
This is my RadDateTimePicker:

<telerik:RadDateTimePicker DateTimeWatermarkContent="Select a date"
                           StartTime="00:00"
                           EndTime="23:59"
                           TimeInterval="1:00"
                           Style="{StaticResource ResourceKey=RadDateTimePickerStyle}"  >
</telerik:RadDateTimePicker>

And this is my style: 

<Style x:Key="RadDateTimePickerStyle"
              TargetType="{x:Type telerik:RadDateTimePicker}">
      <Setter Property="telerik:StyleManager.Theme"
              Value="Windows8Touch" />
      <Setter Property="Margin"
              Value="5" />......


And i've tried to apply the theme like this too:

<telerik:RadDateTimePicker  DateTimeWatermarkContent="Select a date"
           StartTime="00:00"
           EndTime="23:59"
           TimeInterval="1:00"
           Style="{StaticResource ResourceKey=RadDateTimePickerStyle}"
           telerik:StyleManager.Theme="Windows8Touch" >
</telerik:RadDateTimePicker>


So.. please .. please help me!! 
Thank you in advance!




2 Answers, 1 is accepted

Sort by
0
Accepted
Masha
Telerik team
answered on 12 Dec 2013, 11:24 AM
Hello Roxana,

At the moment Expression Blend will always generate the default Office Black theme when you try to edit the control template of any of RadControls. Applying a theme will only be reflected on the design surface and the generated XAML will still have the Office Black theme as its source.

To modify any theme resource, you can do that by taking the resources from the RadControls installation folder on your machine.  Inside that folder you will find the Themes.Implicit folder which contains all themes resources. RadDateTimePickeris inside the Telerik.Windows.Controls.Input.xaml file. Especially you need the control template of RadDateTimePicker in order to modify the CloseButtonContainer.

Instead of StyleManager, I suggest that you use implicit styles approach for applying Windows8Touch theme.

I hope this information will be helpful.


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 >>
0
Roxana
Top achievements
Rank 1
answered on 12 Dec 2013, 12:08 PM

Hello Masha,
Thank you for replying in such a short time.

I edited the control template of RadDateTimePicker and modified all the places where was applied Office Black Theme and that didn't worked eather.
But, in the end, i've resolved the problem.
So, from Blend i've edited a copy of template. In the template, i've replaced

<DiscreteObjectKeyFrame KeyTime="0" Value="{DynamicResource}"/>

with 

<DiscreteObjectKeyFrame KeyTime="0">
          <DiscreteObjectKeyFrame.Value>
                    <SolidColorBrush>
                          Black
                    </SolidColorBrush>
         </DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>

in all places from template, because the first variant was throwing exception in blend. After that, i've changed the content of Close Button from CloseButtonContainer, and finally my RadDateTimePicker looks like this:

<telerik:RadDateTimePicker DateTimeWatermarkContent="Select a date"
           telerik:StyleManager.Theme="Windows8Touch"
           StartTime="00:00"
           EndTime="23:59"
           TimeInterval="1:00"
           Template="{DynamicResource RadDateTimePickerControlTemplate1}">
   </telerik:RadDateTimePicker>

And now i have my control with Close Button content changed and with Windows 8 Touch Theme applied.

Roxana


Tags
DateTimePicker
Asked by
Roxana
Top achievements
Rank 1
Answers by
Masha
Telerik team
Roxana
Top achievements
Rank 1
Share this question
or