Custom ControlTemplate with specific style

6 posts, 1 answers
  1. Julien
    Julien avatar
    2 posts
    Member since:
    Jun 2011

    Posted 15 Jul 2011 Link to this post

    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.
  2. Answer
    Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 21 Jul 2011 Link to this post

    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!

  3. UI for WPF is Visual Studio 2017 Ready
  4. Julien
    Julien avatar
    2 posts
    Member since:
    Jun 2011

    Posted 22 Jul 2011 Link to this post

    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,
  5. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 26 Jul 2011 Link to this post

    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!

  6. Menucha Greenhut
    Menucha Greenhut avatar
    3 posts
    Member since:
    Jun 2010

    Posted 28 Mar 2012 Link to this post

    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 :)
  7. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 30 Mar 2012 Link to this post

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