This question is locked. New answers and comments are not allowed.
Hello,
I have a big problem with the " CustomTimeRulerItemStyleSelector ". I explain the problem :
I use a xaml page "Agenda.xaml" associated with a VB page "Agenda.vb". My VB page possess a public class : "Agenda".
I read the documentation "http://www.telerik.com/help/wpf/radscheduleview-styles-and-templates-styling-timeruleritems.html" several times but I am not come to do what I wanted. I wish I had the same thing as the last photo documentation (http://www.telerik.com/help/wpf/media/timeruler_12.PNG)
I have have copied this code :
and this code in xaml page:
Have you a simle and practical solution ?
Thanks
I have a big problem with the " CustomTimeRulerItemStyleSelector ". I explain the problem :
I use a xaml page "Agenda.xaml" associated with a VB page "Agenda.vb". My VB page possess a public class : "Agenda".
I read the documentation "http://www.telerik.com/help/wpf/radscheduleview-styles-and-templates-styling-timeruleritems.html" several times but I am not come to do what I wanted. I wish I had the same thing as the last photo documentation (http://www.telerik.com/help/wpf/media/timeruler_12.PNG)
I have have copied this code :
xmlns:local="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.ScheduleView"
and this code in xaml page:
<
local:CustomTimeRulerItemStyleSelector.MajorTickLineStyle
>
<
Style
TargetType
=
"scheduleView:TimeRulerLine"
>
<
Setter
Property
=
"BorderBrush"
Value
=
"LightCoral"
/>
<
Setter
Property
=
"Background"
Value
=
"White"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"scheduleView:TimeRulerLine"
>
<
Border
x:Name
=
"LineVisual"
BorderBrush
=
"{TemplateBinding BorderBrush}"
Background
=
"{TemplateBinding Background}"
BorderThickness
=
"0 1 0 0"
/>
<
ControlTemplate.Triggers
>
<
Trigger
Property
=
"Orientation"
Value
=
"Horizontal"
>
<
Setter
TargetName
=
"LineVisual"
Property
=
"BorderThickness"
Value
=
"1 0 0 0"
/>
</
Trigger
>
</
ControlTemplate.Triggers
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
</
local:CustomTimeRulerItemStyleSelector.MajorTickLineStyle
>
<
local:CustomTimeRulerItemStyleSelector.MinorTickLineStyle
>
<
Style
TargetType
=
"scheduleView:TimeRulerLine"
>
<
Setter
Property
=
"BorderBrush"
Value
=
"Khaki"
/>
<
Setter
Property
=
"Background"
Value
=
"White"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"scheduleView:TimeRulerLine"
>
<
Border
x:Name
=
"LineVisual"
BorderBrush
=
"{TemplateBinding BorderBrush}"
Background
=
"{TemplateBinding Background}"
BorderThickness
=
"0 1 0 0"
/>
<
ControlTemplate.Triggers
>
<
Trigger
Property
=
"Orientation"
Value
=
"Horizontal"
>
<
Setter
TargetName
=
"LineVisual"
Property
=
"BorderThickness"
Value
=
"1 0 0 0"
/>
</
Trigger
>
</
ControlTemplate.Triggers
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
</
local:CustomTimeRulerItemStyleSelector.MinorTickLineStyle
>
and this VB code in VB page, following the class "Agenda"
But I have an error : The MinorTickLineStyle not found on CustomTimeRulerItemStyleSelector.. and I thing that my "local:" not found CustomTimeRulerItemStyleSelector..Public
Class
CustomTimeRulerItemStyleSelector
Inherits
OrientedTimeRulerItemStyleSelector
Public
Property
MinorTickLineStyle()
As
Style
Get
Return
m_MinorTickLineStyle
End
Get
Set
m_MinorTickLineStyle = Value
End
Set
End
Property
Private
m_MinorTickLineStyle
As
Style
Public
Property
MajorTickLineStyle()
As
Style
Get
Return
m_MajorTickLineStyle
End
Get
Set
m_MajorTickLineStyle = Value
End
Set
End
Property
Private
m_MajorTickLineStyle
As
Style
Public
Overrides
Function
SelectStyle(item
As
Object
, container
As
DependencyObject, activeViewDeifinition
As
ViewDefinitionBase)
As
Style
If
TypeOf
container
Is
TimeRulerLine
Then
Dim
tick
As
TickData = TryCast(item, TickData)
If
tick.Type = TickType.Major
Then
Return
MajorTickLineStyle
End
If
Return
MinorTickLineStyle
End
If
Return
MyBase
.SelectStyle(item, container, activeViewDeifinition)
End
Function
End
Class
Have you a simle and practical solution ?
Thanks