ResourceStorage Class
Namespace: DevExpress.Xpf.Scheduler
Assembly: DevExpress.Xpf.Scheduler.v24.2.dll
NuGet Package: DevExpress.Wpf.Scheduler
Declaration
public class ResourceStorage :
PersistentObjectStorageBase<IResourceStorageBase, Resource>
Related API Members
The following members return ResourceStorage objects:
Remarks
Important
You are viewing documentation for the legacy WPF Scheduler control. If you’re starting a new project, we strongly recommend that you use a new control declared in the DevExpress.Xpf.Scheduling namespace. If you decide to upgrade an existing project in order to switch to the updated scheduler control, see the Migration Guidelines document.
Appointments in the Scheduler control can be associated with resources. A resource is an object that exposes the Resource interface.
The Scheduler control allows appointments to be grouped by resources. Use the SchedulerControl.GroupType property to specify the required group mode.
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 IPersistentObject.Id property.
Connecting the ResourceStorage object to a data source via the PersistentObjectStorage<T>.DataSource and PersistentObjectStorage<T>.DataMember properties 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 and DataMember properties of the AppointmentStorage object (see Lesson 5 - Bind a Scheduler to Entity Framework Data Source (legacy)). 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 (How to: Bind a Scheduler to MS Access Database (Part 2) (legacy)).
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ResourceStorage class.
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.