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

Custom theme for RadTimeline

1 Answer 204 Views
TimeLine
This is a migrated thread and some comments may be shown as answers.
Johannes
Top achievements
Rank 1
Johannes asked on 24 Jun 2012, 08:32 PM
I'm trying to make a custom theme for the RadTimeline. 

Im my custom theme, I want to wrap a ScrollViewer around the Timeline's TimelineItemContainer just like described in this post: http://www.telerik.com/community/forums/silverlight/timeline/vertical-scrollbar-scrollviewer-and-radtimeline.aspx 
and I want to remove the horizontal scrollbar of the control (the RadSlider at the bottom).

I've tried to create a custom theme using the approach described here:
http://www.telerik.com/help/silverlight/common-styling-apperance-themes-custom-theme-project-telerik-approach.html 
(albeit the documentation is for Silverlight, couldn't find anything similar for WPF)
and I've also had a look at the sample project here:
http://www.telerik.com/community/forums/wpf/general-discussions/how-can-i-create-a-custom-theme-for-wpf-application.aspx 

I couldn't manage to get the theme working.
I'm not sure if I made everything right in the theme project - especially the following things in the XAML of my custom theme:
  •  <my:MyTheme x:Key="Theme" />
  • The many references to ThemeType=telerik:Office_BlackTheme
  • content of Generic.xaml
  • declaration of MyTheme class
Basically, I've just copied the file C:\Program Files (x86)\Telerik\RadControls for WPF Q1 2012 SP1\Themes\WPF40\Windows7\Themes\Telerik.Windows.Controls.DataVisualization.xaml which contains the style for RadTimeline to my CustomTheme project and modified the style there. I'm not quite sure, if that was correct, or what I've done wrong.


Actually, it doesn't have to be a whole custom theme, I just want to change the style of RadTimeline like described above. So, my first try was to edit the style using Expression Blend. I selected the RadTimeline and chose: Edit Template --> Edit a Copy. This alone shouldn't change the style at all, shouldn't it? But instead, the whole control is white/transparent - please see the attached files before_edit_template.png and after_edit_template.png. I expect it to look exactly the same as before calling Edit Template --> Edit a Copy. Why isn't it?

Here (http://johannes.unterguggenberger.info/TimelineCustomTheme.zip) is a Solution which contains 2 Projects: A custom theme project and a project which uses the custom theme (at least tries to) to change the style of a RadTimeline. Maybe someone could have a look at it and maybe tell me, what's the problem, or point me in a direction.

Thanks in advance!

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetie
Telerik team
answered on 26 Jun 2012, 02:33 PM
Hi Johannes,

First of all, I would like to explain what would be the best approach in your case. Taking into account all information that you provided to describe your scenario and expected result, I would recommend that you take the implicit style approach. Please refer to this help topic for additional information on the matter.

Now, I will do my best to answer all your questions. In case I omit a question, just let me know:
  • Indeed, there are no such topics in our WPF documentation, but as of Q2 2012 we are recommending to our customers to use the implicit styles approach.
  • Regarding the custom theme, built based on the help topic for Silverlight - I cannot be sure why your custom theme did not work, unless I take a look at it. In case you decide to use a custom theme, please open a formal support ticket and send me your code.
  • Regarding Expression Blend - unfortunately it seems that there is a problem already reported to Microsoft with the ItemSource property. You can fix it by adding an ItemSource to the TimelineGroupPeriodContainer, TimelinePeriodContainera and the TimelineItemContainer (the names of the classes are relevant for the Q2 2012 release): 
    <Telerik_Windows_Controls_Timeline:TimelineGroupPeriodContainer x:Name="PART_TimelineGroupPeriodContainer" ItemsSource="{TemplateBinding IntervalGroups}"  ItemHeaderStyle="{TemplateBinding GroupPeriodHeaderStyle}" Grid.Row="0">
    ....
      
    <Telerik_Windows_Controls_Timeline:TimelinePeriodContainer x:Name="PART_TimelinePeriodContainer" ItemsSource="{TemplateBinding IntervalItems}" ItemHeaderStyle="{TemplateBinding PeriodHeaderStyle}" Grid.Row="1">
    ....
      
    <Telerik_Windows_Controls_Timeline:TimelineItemContainer x:Name="PART_TimelineItemContainer"  ItemsSource="{TemplateBinding GroupedDataItems}" Grid.Row="0" Grid.RowSpan="2" SelectionRegionControl="{Binding ElementName=PART_SelectionRegion}">
    We are trying to work around the problem, but I cannot give you an estimate, when the fix will be available.

 All the best,
Tsvetie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TimeLine
Asked by
Johannes
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or