Hi,
I want to derive from Telerik.Windows.Controls.ScheduleView.Slot to add some extra information as IsHoliday to my special slots and than use this in my special slot style selector. My scheduler binds to an ObservableCollection<CSchedulerSlot> as SpecialSlotsSource.
But the "object item" which is passed to SelectStyle method of the selector is always of type Slot instead of my custom class CSchedulerSlot. The following code does not work, becuase i always get a an InvalidCastException.
What I'm doing wrong? Is there a workaround for this?
thanks in advance,
michael
I want to derive from Telerik.Windows.Controls.ScheduleView.Slot to add some extra information as IsHoliday to my special slots and than use this in my special slot style selector. My scheduler binds to an ObservableCollection<CSchedulerSlot> as SpecialSlotsSource.
But the "object item" which is passed to SelectStyle method of the selector is always of type Slot instead of my custom class CSchedulerSlot. The following code does not work, becuase i always get a an InvalidCastException.
public
override
Style SelectStyle(
object
item, DependencyObject container, ViewDefinitionBase activeViewDefinition)
{
FrameworkElement elem = container
as
FrameworkElement;
if
(elem ==
null
)
return
base
.SelectStyle(item, container, activeViewDefinition);
CSchedulerSlot slot = (CSchedulerSlot)item;
What I'm doing wrong? Is there a workaround for this?
thanks in advance,
michael