Re-hosted Workflow Designer - Read-Only View

I again placed the workflow designer in my application. Now I want the workflow to be read-only. I know that I can disable drag & drop, but delete and move should also be disabled. I still want the user to be able to scroll in the view.

Can someone help.

Regards, Michael

+4
source share
2 answers

You can access the constructor view to do something like this.

var designerView = myDesigner.Context.Services.GetService<DesignerView>(); 

Then set readonly mode.

 designerView.IsReadOnly = true; 

It will also do a readonly property scan - not sure if this is what you need or not.

+5
source

I came up with this solutaion:

  • Created a MessageFilter inherited from WorkflowDesignerMessageFilter, and bound it to a WorkflowView.
  • Override Method OnKeyDown

      if (eventArgs.KeyCode == Keys.Delete) { if(m_WorkflowView.AllowDrop) { return base.OnKeyDown(eventArgs); } } return true; 

In this case, I set AllowDrop to false for read-only viewing and true in DesignTime. If anyone has a better suggestion, please let me know.

Regards, Michael

+2
source

All Articles