All docs
V21.2
21.2
21.1
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

EnumItemsSourceBehavior.ImageSize Property

Gets or sets the item’s image size (in pixels). This is a dependency property.

Namespace: DevExpress.Mvvm.UI

Assembly: DevExpress.Xpf.Core.v21.2.dll

Declaration

public Size? ImageSize { get; set; }

Property Value

Type Description
Nullable<Size>

The image wide and height (in pixels).

Remarks

You can specify an enumeration member’s Image attribute to display images in a target control’s items. Use the AllowImages property to specify whether images are displayed.

<UserControl ...
    xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"/>
    <Grid>
        <dxe:ComboBoxEdit Name="comboBoxEdit">
            <dxmvvm:Interaction.Behaviors>
                <dxmvvm:EnumItemsSourceBehavior EnumType="{x:Type common:UserRole}" SortMode="DisplayName" ImageSize="20,20"/>
            </dxmvvm:Interaction.Behaviors>
        </dxe:ComboBoxEdit>
    </Grid>
</UserControl>
public enum UserRole {
    [Image("pack://application:,,,/Images/Admin.png"), Display(Name = "Admin", Description = "High level of access", Order = 1)]
    Administrator,
    [Image("pack://application:,,,/Images/Moderator.png"), Display(Name = "Moderator", Description = "Average level of access", Order = 2)]
    Moderator,
    [Image("pack://application:,,,/Images/User.png"), Display(Name = "User", Description = "Low level of access", Order = 3)]
    User
}

EnumBeh-03

View Example

See Also