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

Styling the major and minor ticklines

1 Answer 13 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 22 Apr 2015, 09:04 AM

Hi,

I'm following along with the tutorial here here, but I'm running into a problem at the end.

Using the following code from the tutorial I get the error Nested properties are not supported: CustomTimeRulerItemStyleSelector.MajorTickLineStyle

 

<local:CustomTimeRulerItemStyleSelector.MajorTickLineStyle>
    <Style TargetType="scheduleView:TimeRulerLine">
        <Setter Property="BorderBrush" Value="{StaticResource TimeRulerLineStroke}"/>
        <Setter Property="Background" Value="White"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="scheduleView:TimeRulerLine">
                    <Border x:Name="LineVisual" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0 1 0 0" Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="OrientationStates">
                                <VisualState x:Name="Horizontal">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderThickness" Storyboard.TargetName="LineVisual">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>1 0 0 0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Vertical"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</local:CustomTimeRulerItemStyleSelector.MajorTickLineStyle>

Any ideas on what I'm doing wrong?

Thanks,
Jonathan

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 24 Apr 2015, 01:31 PM
Hi Jonathan,

In order to create a custom TimeRulerItemStyleSelector you need first to declare it in Xaml and then create the MajorTickLineStyle and MinorTickLineStyle as shown below:
<local:CustomTimeRulerItemStyleSelector x:Key="CustomTimeRulerItemStyleSelector">
    <local:CustomTimeRulerItemStyleSelector.MajorTickLineStyle>
        <Style TargetType="telerik:TimeRulerLine">
...
        </Style>
    </local:CustomTimeRulerItemStyleSelector.MajorTickLineStyle>
</local:CustomTimeRulerItemStyleSelector>

Also you could check  this sample project from our SDK Repository that demonstrates how to customize the TimeRulerItemStyleSelector.

Hopes this helps.

Regards,
Nasko
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
ScheduleView
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or