Skip to main content
.NET Framework 4.6.2+
  • The page you are viewing does not exist in the .NET 8.0+ platform documentation. This link will take you to the parent topic of the current section.

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

WorkflowWindowsFormsModule.QueryAvailableActivities Event

Occurs prior to loading the rehosted workflow designer.

Namespace: DevExpress.ExpressApp.Workflow.Win

Assembly: DevExpress.ExpressApp.Workflow.Win.v24.2.dll

NuGet Package: DevExpress.ExpressApp.Workflow.Win

#Declaration

public event EventHandler<ActivitiesInformationEventArgs> QueryAvailableActivities

#Event Data

The QueryAvailableActivities event's data class is ActivitiesInformationEventArgs. The following properties provide information specific to this event:

Property Description
ActivitiesInformation Specifies activities that will be available in the rehosted workflow designer’s toolbox.

#Remarks

Handle this event to customize the list of activities that will be available in the rehosted workflow designer’s toolbox. The following code snippet demonstrates how to remove a MyActivity activity from the toolbox.

using System;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Workflow;
using DevExpress.ExpressApp.Workflow.Win;
//...
public class MyWindowController : WindowController {
    WorkflowWindowsFormsModule workflowModuleWin;
    protected override void OnActivated() {
        base.OnActivated();
        workflowModuleWin = Application.Modules.FindModule<WorkflowWindowsFormsModule>();
        if (workflowModuleWin != null)
            workflowModuleWin.QueryAvailableActivities += OnQueryAvailableActivities;
    }
    void OnQueryAvailableActivities(object sender, ActivitiesInformationEventArgs e) {
        ActivityInformation myActivity = 
            e.ActivitiesInformation.Find(i => i.DisplayName == "MyActivity");
        e.ActivitiesInformation.Remove(myActivity);
    }
    protected override void OnDeactivated() {
        if (workflowModuleWin != null) {
            workflowModuleWin.QueryAvailableActivities -= OnQueryAvailableActivities;
            workflowModuleWin = null;
        }
        base.OnDeactivated();
    }
}

To see an example of handling this event to add new activities to the toolbox, refer to the Add Activities to the Workflow Designer Toolbox help topic.

See Also