Skip to main content

ShowViewParameters Class

A set of parameters used to display a new View.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v25.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public class ShowViewParameters

Remarks

Use the ShowViewParameters object to specify view settings for the View.

The following example demonstrates how to use a ShowViewParameters object in an Action’s Execute event handler. The code customizes the Accept Action:

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.ExpressApp.SystemModule;
using MainDemo.Module.BusinessObjects;

namespace YourApplicationName.Blazor.Server.Controllers {
    public class ShowViewController : ViewController {
        SimpleAction showViewAction;

        public ShowViewController() {
            showViewAction = new SimpleAction(this, "ShowEmployeesList", 
                DevExpress.Persistent.Base.PredefinedCategory.Edit);
            showViewAction.Execute += ShowViewAction_Execute;
        }

        private void ShowViewAction_Execute(object sender, SimpleActionExecuteEventArgs e) {
            IObjectSpace objectSpace = Application.CreateObjectSpace(typeof(Employee));
            string listViewId = Application.FindListViewId(typeof(Employee));
            e.ShowViewParameters.CreatedView = Application.CreateListView(
               listViewId, 
               Application.CreateCollectionSource(objectSpace, typeof(Employee), listViewId),
               true);
            e.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
            var dlgCnt = Application.CreateController<DialogController>();
            dlgCnt.Accepting += DlgCnt_Accepting;
            e.ShowViewParameters.Controllers.Add(dlgCnt);
        }

        private void DlgCnt_Accepting(object sender, DialogControllerAcceptingEventArgs e) {
            // Add your custom code here.
        }
    }
}

Note

XAF creates a DialogController for Pop-up Windows by default.

XafApplication.ShowViewStrategy manages Window and View visibility. This strategy may use properties of a ShowViewParameters object.

Inheritance

Object
ShowViewParameters
See Also