Hi,
I have created an WPF application by rehosting workflow designer.
I have created custom activities and created them as a dll.
If i add reference to the dll's in design time i could use the dll's custom activities.
Now the issue is i want to load the activities from the dll's which are kept in a folder.
Example: User creates an dll with custom activities and places in a folder. If the application[Main WPF Application] is opened all the activities present as dll in the folder should be loaded in the activity toolbox for using in the workflow.
Request soonest help on the above...
What I have tried:
namespace ThirdParty
{
public sealed class ThirdPartyActivity : CodeActivity
{
// Define an activity input argument of type string
public InArgument<string> Text { get; set; }
// If your activity returns a value, derive from CodeActivity<tresult> // and return the value from the Execute method.
protected override void Execute(CodeActivityContext context)
{
// Obtain the runtime value of the Text input argument
string text = context.GetValue(this.Text);
Activity act = (Activity)XamlServices.Load(this.Text.Get(context));
WorkflowInvoker.Invoke(act);
}
}
}
Have tried to create a designer with textbox and button, if the user enter the dll path and clicks the button, the functions available inside the dll should be available, but failed. Have invoked external XAML file, but need to do the same with dll.