Skip to main content
A newer version of this page is available. .

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.v18.2.dll

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.

See Also