Skip to main content

SharedImageCollection Class

An image collection that allows you to share images between controls on multiple forms.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v24.1.dll

NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core

Declaration

public class SharedImageCollection :
    Component,
    ISupportInitialize,
    IImageCollectionBase

Remarks

The SharedImageCollection is an ImageCollection descendant. It allows the collection to share images between controls on multiple forms.

The contents of all SharedImageCollections in the same project are synchronized. You can drop a SharedImageCollection on a form and add images to this collection, and then drop another SharedImageCollection on another form and access the same images in this form.

Note

Images in SharedImageCollections in different forms are synchronized at design time only if the forms remain open.

The ImageSize property specifies the size of images when they are displayed in a control. The SharedImageCollection does not resize images according to the ImageSize property when the images are added to the collection.

Use the ImageSource property to add images to the collection at runtime. At design time, you can use the component’s smart tag menu to load images from various sources.

shared-image-collection-choose-images-editor

See the following topic for more information: ImageCollection.

You can load images to a SharedImageCollection from a project’s resources (the project should be built before the images are loaded). Note that you cannot use a project’s resources to share images between multiple projects in a solution. To share images between multiple projects, load images from the disk or use an image library. See the Load Images from External Assembly section in the following help topic for more information: ImageCollection.

Inheritance

See Also