Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

ShowViewParameters Class

Represents a set of parameters used to display a new View.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v19.2.dll

Declaration

public class ShowViewParameters

Remarks

When handling the Execute event of an ActionBase class descendant, you can specify a View to be displayed after the Action execution. For this purpose, use the ShowViewParameters object passed as the Execute event handler’s ActionBaseEventArgs.ShowViewParameters parameter. Set the View to be displayed for the ShowViewParameters.CreatedView property. To specify the type of the Window that will contain the created View, use the ShowViewParameters.TargetWindow property. To specify a Template context for the target Window, specify the ShowViewParameters.Context property. In addition, you can specify the Controllers to be activated for the View and the Window to be displayed. For this purpose, use the ShowViewParameters.Controllers collection. For instance, add a DialogController to this collection if the target Window is a pop-up. The following code demonstrates how to use a ShowViewParameters object in an Action’s Execute event handler.

using DevExpress.ExpressApp.SystemModule;
// ...
void myAction_Execute(Object sender, SimpleActionExecuteEventArgs e) {
   IObjectSpace 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.NewModalWindow;
   e.ShowViewParameters.Controllers.Add(Application.CreateController<DialogController>());
}

The properties specified for a ShowViewParameters object are considered by the active WinApplication.ShowViewStrategy or XafApplication.ShowViewStrategy which manages the Windows and Views display. In special scenarios, you may need to call the ShowViewStrategyBase.ShowView method to show a View. In this instance, you will have to create a ShowViewParameters object, and pass it as a parameter.

Inheritance

Object
ShowViewParameters
See Also