Skip to main content
.NET 8.0+

XafApplication.ShowViewStrategy Property

Specifies the application’s Show View Strategy.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

[Browsable(false)]
public ShowViewStrategyBase ShowViewStrategy { get; set; }

Property Value

Type Description
ShowViewStrategyBase

A ShowViewStrategyBase descendant that defines the application’s Show View Strategy.

Remarks

A Show View Strategy is the object that manages how to display Views: whether to show a View in a lookup or common Window, in a new or the current Window, in a pop-up or modal Window, and so on. XAF supplies several Show View Strategies:

XAF uses the following strategies by default:

ASP.NET Core Blazor
BlazorShowViewStrategy
Windows Forms
ShowInMultipleWindowsStrategy
ASP.NET Web Forms
ShowViewStrategy In ASP.NET Core Blazor and Windows Forms applications, the type of UI depends on the specified value of the IModelOptionsBlazor.UIType and IModelOptionsWin.UIType property respectively. For more information about Show View Strategies, refer to the ShowViewStrategyBase class description.

To change the Show View Strategy, use the ShowViewStrategy property. The code below demonstrates how to set the MdiShowViewStrategy for the Windows Forms application. This strategy shows all Views in tabs.

Create an instance of the MdiShowViewStrategy class and assign it to the WinApplication.ShowViewStrategy property in the Program.cs file before the XafApplication.Setup method call.

public static void Main(string[] arguments) {
    // ...
    winApplication.ShowViewStrategy = new MdiShowViewStrategy(winApplication);
    winApplication.Setup();
    winApplication.Start();
    //...
}

Alternatively, you can specify the Application Model‘s UIType property of the Options node.

As the Show View Strategy may change during the application life cycle, we recommend that you subscribe to the ShowViewStrategy event from the XafApplication.ShowViewStrategyChanged event handler in Windows Forms applications. For more information, refer to the following topic: WinShowViewStrategyBase.WinWindowShowing.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ShowViewStrategy property.

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.

See Also