Skip to main content
.NET 8.0+

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

IComplexViewItem Interface

In This Article

Declares members implemented by View Items that have access to the XafApplication object and IObjectSpace of the current View.

Namespace: DevExpress.ExpressApp.Editors

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

public interface IComplexViewItem

#Remarks

When implementing a custom Property Editor or a custom View Item you may want to:

In these scenarios, a View Item or Property Editor requires access to the application object and to the Object Space of the current View. To get these objects, the Property Editor should support the IComplexViewItem interface. This interface exposes a single IComplexViewItem.Setup method that accepts objectSpace and application parameters. This method is called automatically for all IComplexViewItem View Items when a View is shown.

Here is an example of how to implement IComplexViewItem in a PropertyEditor descendant:

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Editors;
// ...
public class CustomPropertyEditor : PropertyEditor, IComplexViewItem {
    private IObjectSpace objectSpace;
    private XafApplication application;

    #region IComplexViewItem Members
    void IComplexViewItem.Setup(IObjectSpace objectSpace, 
XafApplication application) {
        this.objectSpace = objectSpace;
        this.application = application;
    }
    #endregion

    // Example:
    protected override object CreateControlCore() {
        IList dataSource = objectSpace.GetObjects(Model.ModelMember.Type);
        // ...
    }
}
See Also