Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

EnumItemsSourceBehavior.AllowImages Property

Gets or sets whether images in a target control’s items are displayed. This is a dependency property.

Namespace: DevExpress.Mvvm.UI

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

NuGet Package: DevExpress.Wpf.Core

#Declaration

public bool AllowImages { get; set; }

#Property Value

Type Default Description
Boolean true

true if images in a target control’s items are displayed; otherwise, false.

#Remarks

You can specify the Image attribute for enumeration members to display images in a target control’s items.

The code sample below disables images of enumeration items:

<UserControl ...
    xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"/>
    <!-- ... -->
    <ListBox VerticalAlignment="Top">
        <dxmvvm:Interaction.Behaviors>
            <dxmvvm:EnumItemsSourceBehavior EnumType="local:UserRole" AllowImages="False"/>
        </dxmvvm:Interaction.Behaviors>
    </ListBox>
    <!-- ... -->
</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
}
See Also