Back to Devexpress

ShowViewParameters Class

expressappframework-devexpress-dot-expressapp-48630036.md

latest4.4 KB
Original Source

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

csharp
public class ShowViewParameters
vb
Public Class ShowViewParameters

The following members return ShowViewParameters objects:

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:

csharp
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

ShowViewParameters Members

Dialog Controller

Ways to Show a View

Add Actions to a Pop-up Window

Customize ShowViewParameters for Built-in Simple Actions

DevExpress.ExpressApp Namespace