Re-hosting the Workflow Desinger in Read-Only Mode

One of the questions, we get fomr customers is how can we re-host the designer in a Read-Only mode. Well, here you go:

For Re-hosting a Flowchart, we have:

this.wd = new WorkflowDesigner();

this.wd.Load(new Flowchart());

Going further, to make this Flowchart ReadOnly, add:

ReadOnlyState state = this.wd.Context.Items.GetValue<ReadOnlyState>();

state.IsReadOnly = true;

This should get the designer in the read-only mode so that no other activities can be added or none of the activity properties changed.