Hi All,
Can someone tell me how to set properties such as Major/MinorTickLength in code (C#)? In the Telerik ExamplesCS_SL.ScheduleViewConfigurator.Silverlight.Example.xaml file, the binding is
SelectedItem="{Binding ActiveViewDefinition.MinorTickLength, ElementName=ScheduleView, Mode=TwoWay}"
However, in code I don't see MinorTickLength as a property of ActiveViewDefinition. I'm trying to do something like this:
Can someone tell me how to set properties such as Major/MinorTickLength in code (C#)? In the Telerik ExamplesCS_SL.ScheduleViewConfigurator.Silverlight.Example.xaml file, the binding is
SelectedItem="{Binding ActiveViewDefinition.MinorTickLength, ElementName=ScheduleView, Mode=TwoWay}"
However, in code I don't see MinorTickLength as a property of ActiveViewDefinition. I'm trying to do something like this:
public
void
ApplySettings(RadScheduleView scheduleView)<br>
{
if
(scheduleView.ActiveViewDefinition ==
null
)
return
;
if
(DaysToShow.HasValue)
scheduleView.ActiveViewDefinition.VisibleDays = DaysToShow.GetValueOrDefault(scheduleView.ActiveViewDefinition.VisibleDays);
if
(MinorTicks !=
null
)
// scheduleView.ActiveViewDefinition.MinorTickLength = MinorTicks;
// NO MinorTickLength property!
//
if (MajorTicks != null)
scheduleView.ActiveViewDefinition.MajorTickLength = MajorTicks;
if (MinTimeRulerExtent.HasValue)
scheduleView.ActiveViewDefinition.MinTimeRulerExtent = MinTimeRulerExtent.GetValueOrDefault(scheduleView.ActiveViewDefinition.MinTimeRulerExtent);
}
EDIT:
I think I've solved it like this:
MultidayViewDefinition multidayView = scheduleView.ActiveViewDefinition
as
MultidayViewDefinition;
if
(multidayView !=
null
)
{
if
(MinorTicks !=
null
)
multidayView.MinorTickLength = MinorTicks;
if
(MajorTicks !=
null
)
multidayView.MajorTickLength = MajorTicks;
}
Is that the proper way to do it?