ShowViewStrategyBase.ShowViewFromCommonView(View, Frame, ActionBase) Method
Shows a specific View in the same window in Single Document Interface mode, and in a new window or tab in Multiple Document Interface mode.
Namespace: DevExpress.ExpressApp
Assembly: DevExpress.ExpressApp.v25.2.dll
NuGet Package: DevExpress.ExpressApp
Declaration
public void ShowViewFromCommonView(
View view,
Frame sourceFrame = null,
ActionBase sourceAction = null
)
Parameters
| Name | Type | Description |
|---|---|---|
| view | View | A View. |
Optional Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| sourceFrame | Frame | null | A Frame object used by XAF to display a View. |
| sourceAction | ActionBase | null | If XAF displays a View as a result of an Action, this property contains a reference to the Action’s instance. |
Remarks
The ShowViewFromCommonView method opens the specified View.
- In Single Document Interface mode, XAF displays the View in the same window.
- In Multiple Document Interface mode, XAF displays the View in a new Frame (window or tab).
The following code sample creates a controller with action that opens a new ListView in the same window (in SingleWindowSDI mode) or in a separate tab (in TabbedMDI mode).
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.Persistent.Base;
using MySolution.Module.BusinessObjects;
namespace MySolution.Blazor.Server.Controllers;
public class CustomBlazorController : ObjectViewController<DetailView, Contact> {
public CustomBlazorController() {
var myAction = new SimpleAction(this, "MyBlazorAction", PredefinedCategory.Edit);
myAction.Execute += MyAction_Execute;
}
private void MyAction_Execute(object sender, SimpleActionExecuteEventArgs e) {
var objectSpace = Application.CreateObjectSpace(typeof(Contact));
var listView = Application.CreateListView(typeof(Contact), true);
Application.ShowViewStrategy.ShowViewFromCommonView(listView, this.Frame, (ActionBase)sender);
}
}
See Also