Using x:DataType in Scheduler Day/Week Templates in .NET MAUI
Environment
Version | Product | Author |
---|---|---|
11.0.0 | Telerik UI for .NET MAUI Scheduler | Dobrinka Yordanova |
Description
I want to use a custom appointment class with the Scheduler's DayView and WeekView templates in .NET MAUI. However, I am unsure of the correct x:DataType
declaration for the AppointmentTemplate
. When using custom properties in the appointment class, warnings appear, but the application still builds and runs correctly.
This knowledge base article also answers the following questions:
- How do I set the
x:DataType
for Scheduler templates? - What is the
x:DataType
forAppointmentTemplate
in .NET MAUI Scheduler? - How to use a custom appointment class with Scheduler templates?
Solution
To correctly set the x:DataType
for the Scheduler's AppointmentTemplate
, use the AppointmentNode
. Below is an example of how to declare the x:DataType
in XAML:
<DataTemplate x:DataType="telerik:AppointmentNode">
<!-- Template content goes here -->
</DataTemplate>
If using a custom appointment class that inherits from Appointment
, warnings may appear for custom properties. These warnings do not affect the application's build or runtime behavior.