Skip to main content

ViewVariantsModule.VariantsProvider Property

Specifies the IVariantsProvider object that provides a list of view variants available for the specific View, and stores the variant selected by user.

Namespace: DevExpress.ExpressApp.ViewVariantsModule

Assembly: DevExpress.ExpressApp.ViewVariantsModule.v25.2.dll

NuGet Package: DevExpress.ExpressApp.ViewVariantsModule

Declaration

[Browsable(false)]
public IVariantsProvider VariantsProvider { get; set; }

Property Value

Type Description
IVariantsProvider

An IVariantsProvider object that provides a list of view variants available for the specific View, and stores the variant selected by the user.

Remarks

The VariantsProvider property is used by the ViewVariantsModule class to initialize the ViewVariantsModule.FrameVariantsEngine property and by the CustomizeNavigationItemsController class to build additional navigation nodes for view variants. By default, a ModelVariantsProvider object is assigned to the VariantsProvider property when the XafApplication.SetupComplete event occurs if this property is not yet initialized. Add a class that implements the IVariantsProvider interface and assign an instance of this class to the VariantsProvider property if you want to replace the standard behavior.

public sealed partial class MySolutionModule : ModuleBase {
    public override void Setup(XafApplication application) {
        base.Setup(application);
        application.SetupComplete += application_SetupComplete;
    }
    void application_SetupComplete(object sender, EventArgs e) {
        Application.Modules.FindModule<ViewVariantsModule>().VariantsProvider = new DatabaseViewVariantsProvider(Application);
    }
    // ...
}

The DatabaseViewVariantsProvider class is used in the snippet above. This class implementation is demonstrated in the IVariantsProvider topic.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the VariantsProvider 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.

See Also