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

Custom ControlTemplate with specific style

5 Answers 159 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Julien
Top achievements
Rank 2
Julien asked on 15 Jul 2011, 02:56 PM
I used Blend to redefine the template of a RadScheduleView and works fine but use the default style.

But when I change the style :
<telerik:RadScheduleView x:Name="ScheduleView" AppointmentsSource="{Binding Appointments}" Grid.Row="1" Grid.ColumnSpan="2" telerik:StyleManager.Theme="{Binding ElementName=Themes, Path=SelectedItem.Content}">

I lose every changes I made in the template.

So my questions are :
- WItch is the quickest way to define a template aware of the template changing ?
- Shoudl I define one template for each theme ?
- Is it possible to generate with blend the template with a specific theme ?
- Where can I find template of RadScheduleView in each theme ?

Thanks.

5 Answers, 1 is accepted

Sort by
0
Accepted
Konstantina
Telerik team
answered on 21 Jul 2011, 08:52 AM
Hi Julien,

You have to make the changes in each theme. With Blend you can only generate the default one - Office_Black. In order to get the xaml of the other themes you have to open the source of the controls and open the ScheduleView solution. Once you build it in the folder Themes you will be able to find all the themes available in different folders. Make all the files visible and use the Schedule.xaml file from the according theme folder.

Regards,
Konstantina
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Julien
Top achievements
Rank 2
answered on 22 Jul 2011, 12:57 PM
Hi Konstantina,

Thank  for your answer, it helps a lot.

But, now, I have another question :
In my solution, I have a folder "Skins" with a ResourceDictionary for each RadScheduleView (onefor each theme). My Question is, how can I change (at startup) the load of the ResourceDictionary I need (choice based on a parameter for example) ?

Other problem, when I define my ResourceDictionary like this

<UserControl.Resources>
  <ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="Skins/RadScheduleViewOfficeBlack.xaml" />
    </ResourceDictionary.MergedDictionaries>
  </ResourceDictionary>
</UserControl.Resources>

I got the message : The element is already the child of another element (I use the Schedule.xaml file from the according theme folder).

Thanks,

Regards,
0
Konstantina
Telerik team
answered on 26 Jul 2011, 03:12 PM
Hi Julien,

You can set the ResourceDictionaries in code behind and in that way you will be able to change them, for example:

this.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri("ScheduleView.xaml", UriKind.RelativeOrAbsolute) });


Regards,
Konstantina
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Menucha Greenhut
Top achievements
Rank 1
answered on 28 Mar 2012, 09:09 AM
what do you mean by saying Schedulig View solution? we havent got the solution for the control.
we need the ScehduleView control style xaml in order to change a certain color etc. (we cannot use blend therefore, we want the whole xaml)
please answer asap as it is very urgent to us.
thanks in advance :)
0
Konstantina
Telerik team
answered on 30 Mar 2012, 03:28 PM
Hi,

You can get the whole xaml of the ScheduleView from the installation folder of the Telerik components on your machine. Usually this is
C://Program Files/Telerik/RadControls for WPF Q1 2012/Themes/ . Inside this folder, search the Themes folder to find the ScheduleView.xaml file that corresponds to your theme of choice.

Kind regards,
Konstantina
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
ScheduleView
Asked by
Julien
Top achievements
Rank 2
Answers by
Konstantina
Telerik team
Julien
Top achievements
Rank 2
Menucha Greenhut
Top achievements
Rank 1
Share this question
or