.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

CurrentUserDisplayImageAttribute Class

Applied to business classes that implement a Security System user. Specifies the name of a property that stores the current user photo or avatar icon. Has effect in the In the New Web UI only.

Namespace: DevExpress.Persistent.Base

Assembly: DevExpress.ExpressApp.v20.2.dll


[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
public class CurrentUserDisplayImageAttribute :
<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Interface)>
Public Class CurrentUserDisplayImageAttribute
    Inherits Attribute


In the New Web UI, an image associated with the current user is displayed at the top right corner of the application page when the IModelApplicationWeb.CurrentUserDisplayMode is set to CaptionAndImage or Image. To provide an individual image for each user, do the following:

  • Declare a property of the MediaDataObject type in your User business class.
  • Apply the CurrentUserDisplayImageAttribute attribute to the class and pass the property name to it.
public class MyAppUser : DCUser, IXafEntityObject, IObjectSpaceLink {
    // ...
    public virtual MediaDataObject Photo { get; set; }
    // ...

The complete example is demonstrated in the XCRM demo application (see %PUBLIC%\Documents\DevExpress Demos 20.2\Components.NET Core Desktop Libraries\eXpressApp Framework\XCRM). This example is based on the Entity Framework data model, but you can use the same approach with the eXpress Persistent Objects (XPO) as well.

The result is demonstrated in the image below.



See Also