Skip to main content
A newer version of this page is available. .

XafApplication.CreateController<ControllerType>() Method

Creates a Controller of a specified type. If there is a Controller of the same type, assigns its settings to the new Controller.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v18.2.dll

Declaration

public virtual ControllerType CreateController<ControllerType>()
    where ControllerType : Controller, new()

Type Parameters

Name
ControllerType

Returns

Type Description
ControllerType

A Controller of the specified type.

Remarks

When you implement a PopupWindowShowAction, you may need to provide a custom Dialog Controller for the Action’s pop-up Window. Use the CreateController<ControllerType> method to create this custom Dialog Controller:

private void MyPopupWindowShowAction_OnCustomizePopupWindowParams(Object sender,
      CustomizePopupWindowParamsEventArgs e) {
   //...
   e.DialogController = Application.CreateController<MyDialogController>();
}

This method creates a Controller of the specified type. If a Controller of the same type already exists, the Controller.Actions of the found Controller serve as a source for the ActionBase.Model property of the new Controller’s Actions.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CreateController<ControllerType>() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also