Hi,
I add appointments programmaticaly to the appointmentslist and calculate the end new. If i calculate an end which is smaler than 1 hour (MinorTickLength = 1h) the ScheduleView shows me anyhow the appointment with 1h lenght. My tooltip shows me the real start and end but the scheduleview appointment-bar not. I set the BeginEdit and Commit things and i remove and add the appointments again to the property, but always he shows me the appointment-bar wrong.
Look at my picture. In this example i have 2 Appointments but it looks like 3 Appointments. What is the little shadow over the green appointment? These "shadow" has the rigth length.
I want that an appointment end is 12:59 pm or the start of the next appointment diff 1 minute. No overlapping!
Here my code:
this is the calculating in method
this is the caller event:
Thanks
Annett
I add appointments programmaticaly to the appointmentslist and calculate the end new. If i calculate an end which is smaler than 1 hour (MinorTickLength = 1h) the ScheduleView shows me anyhow the appointment with 1h lenght. My tooltip shows me the real start and end but the scheduleview appointment-bar not. I set the BeginEdit and Commit things and i remove and add the appointments again to the property, but always he shows me the appointment-bar wrong.
Look at my picture. In this example i have 2 Appointments but it looks like 3 Appointments. What is the little shadow over the green appointment? These "shadow" has the rigth length.
I want that an appointment end is 12:59 pm or the start of the next appointment diff 1 minute. No overlapping!
Here my code:
this is the calculating in method
private
void
RefeshAppointmentSettings()
{
// ... do some stuff
CustomAppointment previous =
null
;
var i = 0;
foreach
(var custSorted
in
toSort)
{
if
(i > 0)
{
if
(previous !=
null
)
{
previous.End = custSorted.Start.AddMinutes(-1);
}
}
previous = custSorted;
previous.End = previous.Start.Date.AddDays(1).AddMinutes(-1);
i++;
}
Appointments.AddRange(toSort);
// ... do some stuff
}
this is the caller event:
private
void
SwitchTimeSpecialTimeTLostKeyboardFocus(
object
sender, KeyboardFocusChangedEventArgs e)
{
var scheduleViewModel = DataContext
as
ScheduleViewModel;
if
(scheduleViewModel !=
null
)
{
scheduleViewModel.RefeshAppointmentSettings();
_radSchedView.BeginEdit();
var arr =
new
CustomAppointment[scheduleViewModel.Appointments.Count];
scheduleViewModel.Appointments.CopyTo(arr, 0);
scheduleViewModel.Appointments.Clear();
for
(
int
i = 0;i<arr.Length;i++)
{
scheduleViewModel.Appointments.Add(arr[i]);
}
_radSchedView.Commit();
}
}
Thanks
Annett