Skip to main content

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.1.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