DialogController() Constructor
Creates an instance of the DialogController class.
Namespace: DevExpress.ExpressApp.SystemModule
Assembly: DevExpress.ExpressApp.v24.1.dll
NuGet Package: DevExpress.ExpressApp
Declaration
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.