Skip to main content
.NET 6.0+

XafApplication.ViewShown Event

Occurs after a View is shown.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.1.dll

NuGet Package: DevExpress.ExpressApp

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.

See Also