The requested page is not available for the requested platform. You are viewing the content for Default platform.

MobilePropertyEditor Class

The base class for Property Editors that use DevExtreme Widgets and their XAF Mobile Wrappers.

Namespace: DevExpress.ExpressApp.Mobile.Editors

Assembly: DevExpress.ExpressApp.Mobile.v19.1.dll

Declaration

public abstract class MobilePropertyEditor :
    PropertyEditor,
    IComplexViewItem,
    ISupportViewEditMode,
    IClientModelAware
Public MustInherit Class MobilePropertyEditor
    Inherits PropertyEditor
    Implements IComplexViewItem,
               ISupportViewEditMode,
               IClientModelAware

Remarks

Inherit this class to implement a Property Editor using DevExtreme widgets.

In Mobile XAF applications, Detail Views can be displayed in two modes - view (read only) and edit (editable). The MobilePropertyEditor.ViewEditMode property specifies the current display mode of the Property Editor's widget.

Typical implementation of the MobilePropertyEditor class' descendants comprises overriding the virtual methods listed below.

  • Override the CreateEditModeControlCore method to instantiate and setup a control to be used in the edit mode.

    protected override Component CreateEditModeControlCore() {
        return new MyCustomEditModeControl();
    }
    
  • Override the CreateViewModeControlCore method to instantiate and setup a control to be used in the view mode. If you don't override it, a control with the Label wrapper will be used by default.

    protected override object CreateViewModeControlCore() {
        return new MyCustomViewModeControl();
    }
    
  • Override the GetControlValueCore method. Return the value specified by the MobileListEditor.Control control used in the edit mode.
  • Override the ReadEditModeValueCore virtual method. Pass the PropertyEditor.PropertyValue object to the property of the MobileListEditor.Control control that specifies the displayed content.

    protected override void ReadEditModeValueCore() {
        ((MyCustomViewModeControl)Control)["text"] = BindToCurrentObjectProperty();
    }
    
  • If you have overridden the CreateViewModeControlCore method, additionally override the ReadViewModeValueCore method.

    protected override void ReadViewModeValueCore() {
        ((MyCustomViewModeControl)Control)["text"] = BindToCurrentObjectProperty();
    }
    

A custom Property Editor that derives from the MobilePropertyEditor should not throw exceptions. Exceptions thrown by such a Property Editor interrupt request processing. As a result, the application crashes.

Inheritance

Object
ViewItem
PropertyEditor
MobilePropertyEditor
See Also