Skip to main content

DataSource.AppointmentsSource Property

Gets or sets a collection of objects containing appointment information. This is a dependency property.

Namespace: DevExpress.Xpf.Scheduling

Assembly: DevExpress.Xpf.Scheduling.v24.2.dll

NuGet Package: DevExpress.Wpf.Scheduling

Declaration

public object AppointmentsSource { get; set; }

Property Value

Type Description
Object

A collection of objects which contain appointment information.

Remarks

The AppointmentsSource property supports the MVVM design pattern. See the MVVM Framework topic to learn more.

Important

Appointment mappings are required. Use the DataSource.AppointmentMappings property to specify mappings.

Example

View Example

using System;
using System.Collections.ObjectModel;

namespace SimpleSchedulingExample {
    public class MainViewModel {
        public virtual ObservableCollection<Doctor> Doctors { get; set; }
        public virtual ObservableCollection<MedicalAppointment> Appointments { get; set; }

        protected MainViewModel() {
            CreateDoctors();
            CreateMedicalAppointments();
        }
        private void CreateDoctors() {
            Doctors = new ObservableCollection<Doctor>();
            Doctors.Add(Doctor.Create(Id: 1, Name: "Stomatologist"));
            Doctors.Add(Doctor.Create(Id: 2, Name: "Ophthalmologist"));
            Doctors.Add(Doctor.Create(Id: 3, Name: "Surgeon"));
        }
        private void CreateMedicalAppointments() {
            Appointments = new ObservableCollection<MedicalAppointment>();
            Appointments.Add(MedicalAppointment.Create(
                startTime: DateTime.Now.Date.AddHours(10), endTime: DateTime.Now.Date.AddHours(11),
                doctorId: 1, notes: "", location: "101", categoryId:1, patientName: "Dave Muriel",
                insuranceNumber: "396-36-XXXX", firstVisit: true));
        }
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the AppointmentsSource property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also