A newer version of this page is available. Switch to the current version.

Frame.SetView(View, Boolean, Frame, Boolean) Method

Sets a specified View for the current Frame.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v18.2.dll


public bool SetView(
    View view,
    bool updateControllers,
    Frame sourceFrame,
    bool disposeOldView


Name Type Description
view View

A View object which is set for the current Frame.

updateControllers Boolean

true, if the Frame’s Controllers are activated after setting a new View; otherwise, false.

sourceFrame Frame

A Frame object in which creating a new View was requested.

disposeOldView Boolean

true, if the Frame’s old View should be disposed; otherwise, false.


Type Description

true, if an old View can be changed by another one; otherwise, false.


This overload of the SetView method allows you to apply Application Model changes to a View without recreating it. Save the Frame’s View to a variable, then set the Frame’s View to null. Make the required changes to the model and then set the saved View back to the Frame.

View view = Frame.View;
if(Frame.SetView(null, true, null, false)) {
    // Make required changes with the model here.
    // ...

It is recommended to pass false to the View.LoadModel method to avoid creating controls within this method. Otherwise, the OnViewControlCreated methods of View’s Controllers will not be called.

The complete example of a Controller that uses the SetView method is provided in the How to: Apply Application Model Changes to the Current View Immediately topic.

See Also