Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to bind SchedulerControl to ObservableCollection

$
0
0

This example illustrates how to bind SchedulerControl appointment and resource storages to ObservableCollection instances in the context of the basic MVVM implementation. Custom appointment and resource objects are represented by the ModelAppointment and ModelResource class instances. The SchedulerViewModel class exposes the collections of these objects. Finally, the corresponding view model properties are specified in binding expressions in the MainWindow.xaml markup file.

In addition, this example illustrates how to access the underlying data objects of a certain appointment. Note that the PersistentObject.GetSourceObject Method is used for this purpose.

Note: Data formats, in which the ModelResource.Color and ModelAppointment.ResourceId property values are specified in the SchedulerViewModel.AddTestData() method, are described in the ResourceStorageBase.ColorSaving Property and How to: Enable Multi-resource Appointments help sections correspondingly.

Example Comments

Added By: Brian Morris 01 at: 4/4/2013 1:54:27 PM    

This example has been very helpful...however, I would really like to move the ObservableCollection to the code behind file, "MainWindow.xaml.cs". When do this, something breaks the binding with Appointments. I have moved all the logic from the SchedulerViewModel.cs file into the "MainWindow.xaml.cs" file and now when I run the project the Scheduler is blank. How can one bind to an ObservableCollection in the code behind file?


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>