Back to Devexpress

ViewController.TargetViewNesting Property

expressappframework-devexpress-dot-expressapp-dot-viewcontroller-fdf180e2.md

latest3.8 KB
Original Source

ViewController.TargetViewNesting Property

Specifies whether the View for which a View Controller is intended must be root, nested or any.

Namespace : DevExpress.ExpressApp

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
[DefaultValue(Nesting.Any)]
public Nesting TargetViewNesting { get; set; }
vb
<DefaultValue(Nesting.Any)>
Public Property TargetViewNesting As Nesting

Property Value

TypeDefaultDescription
NestingAny

A Nesting enumeration value identifying a View kind.

|

Available values:

NameDescription
Any

An Action or a View Controller will be activated in Frames (Windows) with any Views.

| | Root |

An Action or a View Controller will be activated in Frames (Windows) which contain root Views (see View.IsRoot).

| | Nested |

An Action or a View Controller will be activated in Frames (Windows) which contain nested Views (the View.IsRoot property is set to false ).

|

Remarks

View Controllers are activated for both Windows and Frames. However, you can specify the View kind to provide a View Controller activation within the Window or Frame via the TargetViewNesting property.

Note

The TargetViewNesting property affects only ViewController’s activation. Controller.FrameAssigned and other events that are irrelevant to the view nesting always fire.

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

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.

xaf-save-and-share-custom-view-settings/CS/EFCore/ViewSettingsEF/ViewSettingsEF.Module/Controllers/ViewVariantsController.cs#L156

csharp
public ViewVariantsController() {
    this.TargetViewNesting = Nesting.Root;
    this.DeleteViewVariantAction = new SimpleAction(this, "DeleteViewVariant", "Edit");

See Also

TargetObjectType

TargetViewId

TargetViewType

Define the Scope of Controllers and Actions

ViewController Class

ViewController Members

DevExpress.ExpressApp Namespace