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);
}
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ShowViewFromCommonView(View, Frame, ActionBase) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.