Esempio n. 1
0
        private void GetSourceObjectCommandExecute(object parameter)
        {
            DevExpress.Xpf.Scheduler.SchedulerStorage storage = (DevExpress.Xpf.Scheduler.SchedulerStorage)parameter;

            if (storage.AppointmentStorage.Count > 0)
            {
                ModelAppointment apt = (ModelAppointment)storage.AppointmentStorage[0].GetSourceObject(storage.GetCoreStorage());
                // Alternative: ModelAppointment apt = (ModelAppointment)storage.GetObjectRow(storage.AppointmentStorage[0]);
                MessageBox.Show("First Appointment Price: " + apt.Price.ToString());
            }
        }
        private void btnGetSourceObject_Click(object sender, RoutedEventArgs e)
        {
            DevExpress.Xpf.Scheduler.SchedulerStorage storage = schedulerControl1.Storage;

            if (storage.AppointmentStorage.Count > 0)
            {
                XPAppointment apt = (XPAppointment)storage.AppointmentStorage[0].GetSourceObject(storage.GetCoreStorage());
                // Alternative: XPAppointment apt = (XPAppointment)storage.GetObjectRow(storage.AppointmentStorage[0]);
                MessageBox.Show("First Appointment Price: " + apt.Price.ToString());
            }
        }