Skip to main content
.NET Framework 4.6.2+

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

DialogController() Constructor

In This Article

Creates an instance of the DialogController class.

Namespace: DevExpress.ExpressApp.SystemModule

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

public DialogController()

#Remarks

When using ShowViewParameters to invoke a popup Window, add the Dialog Controller so that the invoked Window contains the Accept and Cancel buttons. To do this, create an instance of the DialogController class. For this purpose, use the constructor or the XafApplication.CreateController<ControllerType> method. To add the created Dialog Controller to the popup Window, use the ShowViewParameters.Controllers parameter of your Action’s Execute event handler. The following code demonstrates this:

using DevExpress.ExpressApp.SystemModule;
// ...
void myAction_Execute(Object sender, SimpleActionExecuteEventArgs e) {
   ObjectSpace objectSpace = Application.CreateObjectSpace(typeof(MyBusinessClass));
   string listViewId = Application.FindListViewId(typeof(MyBusinessClass));
   e.ShowViewParameters.CreatedView = Application.CreateListView(
      listViewId,
      Application.CreateCollectionSource(objectSpace,typeof(MyBusinessClass),listViewId),
      true);
   e.ShowViewParameters.TargetWindow = TargetWindow.NewWindow;
   e.ShowViewParameters.Controllers.Add(Application.CreateController<DialogController>());
}

Note

In the popup Window that is invoked when executing a PopupWindowShowAction, the Dialog Controller is added automatically. However, you can replace it with any of its descendants via the CustomizePopupWindowParamsEventArgs.DialogController parameter of the PopupWindowShowAction.CustomizePopupWindowParams event handler.

See Also