How to add additional attributes to appointments WinUI Scheduler?
XAML
Handler for CellTapped is defined with the Scheduler .
<Grid>
<Grid.DataContext>
<local:SchedulerViewModel/>
</Grid.DataContext>
<scheduler:SfScheduler x:Name="Schedule" ItemsSource="{Binding AppointmentCollection}" ViewType="Week" CellTapped="OnCellTapped"/>
</Grid>
C#
Create a separate class which inherits from the ScheduleAppointment, and include required properties in this class for adding additional attribute to the appointment.
public class CustomAppointment : ScheduleAppointment, INotifyPropertyChanged
{
private string appointment_ID;
public string AppointmentID
{
get { return appointment_ID; }
set
{
appointment_ID = value;
OnPropertyChanged("AppointmentID");
}
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName)
{
var eventHandler = this.PropertyChanged;
if (eventHandler != null)
eventHandler(this, new PropertyChangedEventArgs(propertyName));
}
}
C#
Schedule a meeting for a day by setting StartTime, EndTime, AppointmentID, AppointmentBackground, and Subject class. Create appointments of type ObservableCollection <CustomAppointment> and assign those appointment collections to the ItemsSource property.
public class SchedulerViewModel
{
public ObservableCollection<CustomAppointment> AppointmentCollection
{
get;
set;
}
CustomAppointment scheduleAppointment;
public SchedulerViewModel()
{
scheduleAppointment = new CustomAppointment();
scheduleAppointment.Subject = "Meeting";
scheduleAppointment.AppointmentID = "579";
scheduleAppointment.AppointmentBackground = Brushes.Green;
scheduleAppointment.StartTime = DateTime.Now.Date.AddHours(10);
scheduleAppointment.EndTime = DateTime.Now.Date.AddHours(12);
AppointmentCollection = new ObservableCollection<CustomAppointment>();
AppointmentCollection.Add(scheduleAppointment);
}
}
C#
In the CellTapped, get the tapped appointment ID details by the property of the Appointment of CellTappedEventArgs.
//Event Customization
private async void OnCellTapped(object sender, CellTappedEventArgs e)
{
var appointment = e.Appointment as CustomAppointment;
if (appointment != null && appointment.Subject == "Meeting")
{
var dateTime = e.DateTime.ToString();
ContentDialog contentDialog = new ContentDialog()
{
Title = "Selected Appointment ID ",
Content = " " + " " + appointment.AppointmentID.ToString(),
CloseButtonText = "Ok"
};
//Set XamlRoot for WinUI desktop applications
contentDialog.XamlRoot = this.Schedule.XamlRoot;
await contentDialog.ShowAsync();
}
}

Take a moment to pursue the documentation. You can find options like types of appointments, customizing the appearance of appointments, etc.
Conclusion
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!