Skip to main content
.NET 6.0+

ShowViewStrategyBase Class

An abstract class that serves as the base class for the Show View Strategy classes.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.1.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public abstract class ShowViewStrategyBase :
    IDisposable

Remarks

A Show View Strategy is an object that manages the display of Views in a UI. When an XAF application needs to display a View in a UI, it is the application’s Show View Strategy that decides where and how to display the View. For example, if you don’t specify the Frame that should display the View, the Show View Strategy resolves the following questions:

  • Should XAF display the View in an existing Frame?
  • Should XAF create a new Window?
  • If XAF should create a new Window, must it be modal?

A Show View Strategy has two main tasks: decide where and how a View should appear, and display the View in the UI.

Consider the following example. When a user clicks a record in a List View that is displayed in the main Window, XAF must invoke a Detail View. This Detail View can be displayed in a UI in different ways. One of the available options is to display the Detail View in a new Window:

SVStrategy1

SVStrategy3

Another option is to display the Detail View in the same Window:

SVStrategy1

SVStrategy2

Additional options are available. For example, you can use a multiple document interface (MDI), so that a new View is displayed in a separate tab within the main Window.

A Show View Strategy has a set of rules that govern all possible scenarios defined within the Strategy. The example above illustrates only one kind of rule - how to display a Detail View invoked from a List View that is displayed in the main Window. Each Strategy, however, has many additional rules – a set of rules for the nested Views, Views that are displayed by the Lookup Property Editors, and so on.

An XAF application instantiates a Show View Strategy when the application starts. It assigns the specific Show View Strategy that the application must use to the XafApplication.ShowViewStrategy property.

The ShowViewStrategyBase class is an abstract class from which all Show View Strategies are derived. The following table lists XAF’s built-in Show View Strategies:

ShowViewStrategyBase Descendant Description
DevExpress.ExpressApp.Blazor.BlazorMdiShowViewStrategy Used in XAF ASP.NET Core Blazor applications. Displays a new View in a separate tab within the main Window.
DevExpress.ExpressApp.Blazor.BlazorShowViewStrategy Used in XAF ASP.NET Core Blazor applications. Displays a new View in the main Window.
ShowViewStrategy Used by default in XAF ASP.NET Web Forms applications.
WinShowViewStrategyBase An abstract class from which all Show View Strategies used in the XAF Windows Forms applications are derived.
ShowInMultipleWindowsStrategy Used by default in XAF Windows Forms applications.
ShowInSingleWindowStrategy A Show View Strategy that can be used as an alternative to the ShowInMultipleWindowsStrategy. A Detail View is invoked from a List View that is displayed in the main Window.
MdiShowViewStrategy Another alternative to the ShowInMultipleWindowsStrategy. Uses multiple-document interface (MDI).
See Also