I've added a Duration property to a custom appointment (based loosely on one of the Telerik demos) but I'd like to have it refresh in the EditAppointment dialog whenever the Start or End time changes. I've added what i thought would be the appropriate override to my custom Appointment:
However, I'm not seeing a change in the dialog when times change. Those DatePicker controls are bound in the template to ActualStart and ActualEnd. Where are those defined and should I be watching those instead of Start and End?
private
string
_apptDur;
public
string
ApptDur
{
get
{
TimeSpan t = TimeSpan.FromMinutes((
this
.End -
this
.Start).TotalMinutes);
this
._apptDur =
""
;
if
(t.Days > 1)
this
._apptDur += t.Days.ToString() +
" days "
;
else
if
(t.Days == 1)
this
._apptDur +=
"1 day "
;
if
(t.Hours > 1)
this
._apptDur += t.Hours.ToString() +
" hours "
;
else
if
(t.Hours == 1)
this
._apptDur +=
"1 hour "
;
if
(t.Minutes > 0)
this
._apptDur += t.Minutes.ToString() +
" min"
;
return
_apptDur;
}
}
protected
override
void
OnPropertyChanged(
string
propertyName)
{
base
.OnPropertyChanged(propertyName);
if
(propertyName ==
"Start"
|| propertyName ==
"End"
)
{
this
.OnPropertyChanged(
"ApptDur"
);
}
}
However, I'm not seeing a change in the dialog when times change. Those DatePicker controls are bound in the template to ActualStart and ActualEnd. Where are those defined and should I be watching those instead of Start and End?