Hi , I used mvvm pattern to prepere data for scheduler ... below you can see my sumrized code. when project start data loaded just today appointment load, when you change visible range ,data loaded truly and "Timeslices" property in "Schedule" updated , but doesn't show nothing.
in View
public
class
Scheduler : INotifyPropertyChanged
{
....
private
Schedule _timeSliceSchedule;
public
Schedule TimeSliceSchedule
{
get
{
return
_timeSliceSchedule;
}
set
{
_timeSliceSchedule = value;
OnPropertyChanged(
"TimeSliceScheduler"
);
}
}
private
bool
_isGettingData;
public
bool
IsGettingData
{
get
{
return
_isGettingData;
}
set
{
_isGettingData = value;
OnPropertyChanged(
"IsGettingData"
);
}
}
private
string
_busyDescription;
TimeSliceTypeCollection _timeSliceTypes =
new
TimeSliceTypeCollection();
public
TimeSliceTypeCollection TimeSliceTypes
{
get
{
return
_timeSliceTypes;
}
set
{
_timeSliceTypes = value;
OnPropertyChanged(
"TimeSliceTypes"
);
}
}
....
#region INotifyPropertyChanged Members
protected
virtual
void
OnPropertyChanged(
string
propertyName)
{
if
(PropertyChanged !=
null
)
PropertyChanged(
this
,
new
PropertyChangedEventArgs(propertyName));
}
public
event
PropertyChangedEventHandler PropertyChanged;
#endregion
}
public
class
Schedule : ViewModelBase, INotifyPropertyChanged
{
....
private
TimeSliceCollection timeSlices;
public
TimeSliceCollection TimeSlices
{
get
{
return
this
.timeSlices;
}
set
{
this
.timeSlices = value;
this
.OnPropertyChanged(
"TimeSlices"
);
}
}
...
#region # Events and Handler
public
delegate
void
VisibleRangeChangedHandler(DateTimeSpan datetimeSpan);
public
event
VisibleRangeChangedHandler VisibleRangeChangedEvent;
#endregion
#region INotifyPropertyChanged Members
protected
virtual
void
OnPropertyChanged(
string
propertyName)
{
if
(PropertyChanged !=
null
)
PropertyChanged(
this
,
new
PropertyChangedEventArgs(propertyName));
}
public
event
PropertyChangedEventHandler PropertyChanged;
#endregion
}
in View
<
UserControl.Resources
>
<
ViewModels:Scheduler
x:Key
=
"Scheduler"
/>
</
UserControl.Resources
>
<
telerik:RadBusyIndicator
Name
=
"busyIndicator"
IsBusy
=
"{Binding Source=Scheduler, Path= IsGettingData}"
BusyContent
=
"Please Wait..."
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
Margin
=
"0,0,0,0"
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
DataContext
=
"{StaticResource Scheduler}"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"30"
/>
<
RowDefinition
Height
=
"1*"
/>
</
Grid.RowDefinitions
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"250"
/>
</
Grid.ColumnDefinitions
>
<
ViewControl:TimeSliceScheduleView
x:Name
=
"timeSliceScheduleView"
DataContext
=
"{Binding TimeSliceSchedule}"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
Grid.Row
=
"1"
Grid.Column
=
"0"
/>
</
Grid
>
</
telerik:RadBusyIndicator
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
FlowDirection
=
"RightToLeft"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"35"
/>
<
RowDefinition
Height
=
"1*"
/>
<
RowDefinition
Height
=
"35"
/>
</
Grid.RowDefinitions
>
<
scheduleView:RadScheduleView
Name
=
"radSchedulerTimeSliceScheduleView"
Grid.Row
=
"1"
Grid.Column
=
"0"
AppointmentsSource
=
"{Binding TimeSlices,Mode=TwoWay}"
VisibleRangeChangedCommand
=
"{Binding VisibleRangeChanged}"
VisibleRangeChangedCommandParameter
=
"{Binding VisibleRange, RelativeSource={RelativeSource Self}}"
>
<
scheduleView:RadScheduleView.ViewDefinitions
>
<
scheduleView:DayViewDefinition
/>
<
scheduleView:WeekViewDefinition
/>
<
scheduleView:MonthViewDefinition
/>
<
scheduleView:TimelineViewDefinition
/>
</
scheduleView:RadScheduleView.ViewDefinitions
>
</
scheduleView:RadScheduleView
>
</
Grid
>