ViewController.SetView(View) Method
Sets a specified View for a View Controller.
Namespace: DevExpress.ExpressApp
Assembly: DevExpress.ExpressApp.v24.2.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Parameters
Name | Type | Description |
---|---|---|
newView | View | A View object that represents a View to be set for the current View Controller. |
Remarks
View Controllers are used to perform specific actions with their View when they are activated (see Controller.Activated). This method sets the View specified by the View parameter to the current View Controller. Not any View can be set to a View Controller. If the specified View do not satisfy to the View Controller’s ViewController.TargetObjectType, ViewController.TargetViewId, ViewController.TargetViewNesting or ViewController.TargetViewType property, it is not assigned.
Generally, you do not need to use this method. When a Controller is registered within a Frame (see Frame.RegisterController), the Frame’s View is assigned automatically. You can override the ViewController.OnViewChanging method that is called before setting a View. For instance, you can prohibit activation of the current View Controller, if it is not intended for the View which is being set to it.