Skip to main content

ResourceStorage Class

A storage which holds appointment resources.

Namespace: DevExpress.Xpf.Scheduler

Assembly: DevExpress.Xpf.Scheduler.v14.2.dll

#Declaration

public class ResourceStorage :
    PersistentObjectStorageBase<ResourceDataStorage, Resource>

#Returned By

The SchedulerStorage.ResourceStorage property returns an instance of ResourceStorage.

#Remarks

Appointments in the scheduler control can be associated with resources. A resource is an object represented by the Resource class which has the following attributes: a unique identifier, caption, color and an object which can store arbitrary data.

The scheduler control allows appointments to be grouped by resources. Use the SchedulerControl.GroupType property to specify the required group mode (see How to: Group Appointments by Resources and How to: Group Appointments by Dates).

The ResourceStorage class represents a storage which holds resources. The functionality of the ResourceStorage class can be accessed via the SchedulerStorage.ResourceStorage property. To get the collection of resources, use the ResourceStorage.Items property.

To associate a resource with an appointment, this resource should be added to the ResourceStorage object and then bound to the appointment via the Appointment.ResourceId property. It represents a resource ID specified by the Resource.Id property.

Connecting the ResourceStorage object to a data source via the DataSource property enables bound mode. In this mode, if the ResourceStorage.AutoReload property is set to true, resources are automatically retrieved from the specified data source and added to the ResourceStorage object, and when data in the data source is modified, the ResourceStorage object automatically reloads the data. If the AutoReload property is set to false, data is not automatically loaded and reloaded from the data source. You should use the SchedulerStorage.RefreshData method to reload data manually in this case.

Use the ResourceStorage.Mappings property to specify which fields in the bound data source hold a resource's caption, color and ID. The values of these fields will be synchronized with the corresponding properties of Resource objects.

Appointments for the scheduler control are stored in the AppointmentStorage object. In bound mode, appointments are retrieved from and stored back to a data source specified by the DataSource property of the AppointmentStorage object (see the Lesson 1 - Bind a Scheduler to Data Using WCF RIA Services document). This data source may contain a field which holds the resource ID of appointments. To enable the resource ID to be automatically retrieved from the database, set the AppointmentMapping.ResourceId property to the name of this field (see Lesson 2 - Provide Resources for Appointments).

#Examples

This example demonstrates how to get access to the scheduler storage and modify its properties. For this, the SchedulerControl.Storage property is used.

#Inheritance

Object
DispatcherObject
DependencyObject
Visual
UIElement
FrameworkElement
DevExpress.Xpf.Core.DXFrameworkElement
DevExpress.Xpf.Scheduler.SchedulerFrameworkElement
DevExpress.Xpf.Scheduler.PersistentObjectStorageBase<DevExpress.Xpf.Scheduler.Native.ResourceDataStorage, Resource>
ResourceStorage
See Also