Hi All!
First post here and I'm very new to the calendar control. I've just started playing with it and am particularly interested in Timetable view. I have no problem creating multiple days, setting up day start, time intervals, work day and adding appointments to the calendar. My problem is disappearing time labels to the left of the control.
Here's my XAML:
<mf:Calendar Grid.Row="1" Theme="Windows2003" Name="calDiary" CurrentView="{Binding ElementName=cbView, Path=SelectedItem}"
LicenseKey="...">
and my code behind:
public void Reset()
{
if (_calendar is not null)
{
_calendar.BeginInit();
_calendar.TimetableSettings = TimetableSettings;
_calendar.TimetableSettings.Dates.Clear();
DateTime start = new(2022, 04, 22);
for (int i = 0; i < 3; i++)
{
_calendar.TimetableSettings.Dates.Add(start + new TimeSpan(i, 0, 0, 0));
}
_calendar.Schedule.Items.Add(new Appointment()
{
HeaderText = "Meet Person A",
DescriptionText = "This is a test appointment",
StartTime = start + new TimeSpan(9, 0, 0),
EndTime = start + new TimeSpan(9, 30, 0)
}
);
_calendar.Schedule.Items.Add(new Appointment()
{
HeaderText = "Meet Person B",
DescriptionText = "This is another test appointment",
StartTime = start + new TimeSpan(1, 10, 0, 0),
EndTime = start + new TimeSpan(1, 10, 30, 0)
}
);
_calendar.EndInit();
}
NotifyPropertyChanged(nameof(Calendar));
}
public static TimetableSettings TimetableSettings
{
get;
private set;
} = new()
{
StartTime = 8 * 60,
EndTime = 18 * 60,
WorkTimeStarts = new() { new(9, 0, 0), new(14, 0, 0) },
WorkTimeEnds = new() { new(13, 0, 0), new(17, 0, 0) },
CellTime = new(0,5,0),
ShowWorkTime = true,
ShowAM = true
};
My first instinct is that there's something else I should be adding to TimetableSettings to enable these labels. Other than that, everything works as expected - the Month View has all its labels. PS: This is a small test project so sorry for the code!
Any suggestions welcome!
Cheers,
Adam