This question is locked. New answers and comments are not allowed.
<
telerik:RadTimeline
PeriodStart
=
"{Binding FromDate, Mode=TwoWay}"
PeriodEnd
=
"{Binding ThruDate, Mode=TwoWay}"
VisiblePeriodStart
=
"{Binding VisiblePeriodStart, Mode=TwoWay}"
VisiblePeriodEnd
=
"{Binding VisiblePeriodEnd, Mode=TwoWay}"
StartPath
=
"DateTime"
DurationPath
=
"Duration"
>
</
telerik:RadTimeline
>
From the ViewModel:
public
DateTime FromDate
{
get
{
return
fromDate; }
set
{ fromDate = value; OnPropertyChanged(
"FromDate"
); }
}
public
DateTime ThruDate
{
get
{
return
thruDate; }
set
{ thruDate = value; OnPropertyChanged(
"ThruDate"
); }
}
I believe I'm doing this properly. When I set the value of FromDate and ThruDate in response to an async data load in the ViewModel, the Timeline doesn't update itself. It looks like the Slider is stuck on the far left, with no span, and no ability to change it.
If however I do not put a Binding on the Timeline's PeriodEnd/Start properties, but hard code the exact same value that I would have otherwise set in the ViewModel, it works fine.
What's up with this?
[EDIT]
I have sort of solved this, poorly, with the following code on my View:
static
void
ViewModel_Changed(
object
sender, DependencyPropertyChangedEventArgs args)
{
var view = (PersonEventsView)sender;
view.ViewModel.PropertyChanged += view.ViewModel_PropertyChanged;
}
void
ViewModel_PropertyChanged(
object
sender, System.ComponentModel.PropertyChangedEventArgs e)
{
switch
(e.PropertyName)
{
case
"FromDate"
:
Timeline.PeriodStart = ViewModel.FromDate;
break
;
case
"ThruDate"
:
Timeline.PeriodEnd = ViewModel.ThruDate;
break
;
}
}