The requested page is not available for the requested platform. You are viewing the content for Default platform.
A newer version of this page is available. Switch to the current version.

ViewController Class

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v18.2.dll

Declaration

public class ViewController :
    Controller
Public Class ViewController
    Inherits Controller

Remarks

A ViewController class is a descendant of the Controller class. Use it as an ancestor for a custom Controller which is intended to function with a View. View Controllers are registered within both a Window and Frame. You can access the parent Frame using the Controller.Frame property, and its View using the ViewController.View property. The Object Space used by the current View can be accessed via the protected ObjectSpace property. To implement custom code to be performed at runtime, use the Controller's mechanisms for activation and deactivation, i.e., handle the Controller.Activated and Controller.Deactivated events.

You can specify the Views for which a View Controller will be activated. For this purpose, use the ViewController.TargetObjectType, ViewController.TargetViewId, ViewController.TargetViewNesting and ViewController.TargetViewType properties (see How do I specify in which View (form) a Controller should be activated). You can also prohibit Controller activation for a particular View by overriding the ViewController.OnViewChanging method.

If you need to implement features with Windows (e.g., customize a Window's Template or View), use the WindowController class instead of ViewController.

See Also