.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET 5.0+

XafApplication.ViewShown Event

Occurs after a View is shown.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v21.2.dll

Declaration

public event EventHandler<ViewShownEventArgs> ViewShown

Event Data

The ViewShown event's data class is ViewShownEventArgs. The following properties provide information specific to this event:

Property Description
SourceFrame Provides access to the Frame in which a newly created View was requested to be created.
TargetFrame Provides access to the Frame in which a View will be created.

Remarks

In many scenarios, a View is not shown in the Frames, in which the command to show this View has been performed, but in a separate Frames. Let these Frames be called a source Frame and a target Frame. When implementing custom features, you may need to pass some values from the source Frame to the target Frame. For instance, the RecordsNavigationController‘s PreviousObject and NextObject Actions displayed in a Detail View allows navigating to the previous and next record in the List View from which this Detail View has been shown. Here, the target Frame (the Frame with the Detail View) obtains information on the order of objects in the source Frame (the Frame with the List View).

To implement such feature where you need to exchange data between the source and target Frames, handle the XafApplication.ViewShowing and ViewShown events. The former event is raised before showing a View in the target Frame, the latter - after showing this View. To access the source and target Frames, use the handler’s parameters. In addition, the XafApplication.ViewShowing event handler provides the ViewShowingEventArgs.View parameter.

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

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