Category / Section
How to add custom fonts in WPF Scheduler (Calendar)
1 min read
In the WPF SfScheduler, you can provide the custom font style for text of the Header, ViewHeader, MonthCell, WeekNumber, Appointment and Timeline Header, ViewHeader.
Download and add the required custom fonts in the fonts folder.
XAML
Use the custom font in specific style by using TargetType as SchedulerHeaderControl, MonthCell, ViewHeaderControl, DayViewHeader, MonthAgendaView, WeekNumberCell, TimelineViewHeader, TimeRulerCell, AppointmentControl, MonthViewHeader.
<Style TargetType="syncfusion:SchedulerHeaderControl"> <Setter Property='FontFamily' Value="fonts/bradhitc.ttf #Bradley Hand ITC"/> </Style> <Style TargetType="syncfusion:MonthCell"> <Setter Property='FontFamily' Value="fonts/bradhitc.ttf #Bradley Hand ITC"/> </Style> <Style TargetType="syncfusion:ViewHeaderControl"> <Setter Property='FontFamily' Value="fonts/bradhitc.ttf #Bradley Hand ITC"/> </Style> <Style TargetType="syncfusion:DayViewHeader"> <Setter Property='FontFamily' Value="fonts/bradhitc.ttf #Bradley Hand ITC"/> </Style> <Style TargetType="syncfusion:MonthAgendaView"> <Setter Property='FontFamily' Value="fonts/bradhitc.ttf #Bradley Hand ITC"/> </Style> <Style TargetType="syncfusion:WeekNumberCell"> <Setter Property='FontFamily' Value="fonts/bradhitc.ttf #Bradley Hand ITC"/> </Style> <Style TargetType="syncfusion:TimelineViewHeader"> <Setter Property='FontFamily' Value="fonts/bradhitc.ttf #Bradley Hand ITC"/> </Style> <Style TargetType="syncfusion:TimeRulerCell"> <Setter Property='FontFamily' Value="fonts/bradhitc.ttf #Bradley Hand ITC"/> </Style> <Style TargetType="syncfusion:AppointmentControl"> <Setter Property='FontFamily' Value="fonts/bradhitc.ttf #Bradley Hand ITC"/> </Style> <Style TargetType="syncfusion:MonthViewHeader"> <Setter Property='FontFamily' Value="fonts/bradhitc.ttf #Bradley Hand ITC"/> </Style>
XAML
Bind the appointments to a schedule by using the Scheduler.ItemsSource and set the ShowAgendaView and ShowWeekNumber value as True.
<syncfusion:SfScheduler x:Name="Schedule" ViewType="{Binding ElementName=viewTypeComboBox, Path=SelectedValue}" ItemsSource="{Binding Appointments}"> <syncfusion:SfScheduler.MonthViewSettings> <syncfusion:MonthViewSettings ShowWeekNumber="True" ShowAgendaView="True" AppointmentDisplayMode="Indicator"> </syncfusion:MonthViewSettings> </syncfusion:SfScheduler.MonthViewSettings> </syncfusion:SfScheduler>