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.v18.2.dll

Declaration

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
public class CurrentUserDisplayImageAttribute :
    Attribute,
    _Attribute
<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Interface)>
Public Class CurrentUserDisplayImageAttribute
    Inherits Attribute
    Implements _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.
[CurrentUserDisplayImage("Photo")]
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 18.2\Components\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.

CurrentUserImage

Inheritance

Object
Attribute
CurrentUserDisplayImageAttribute

See Also