none
ReadOnly workflow designer RRS feed

  • Question

  • Hi,

    I am looking to display the workflow designer in a read only mode so that I can show the workflow without the user being able to edit it.

    I tried to accomplish this by setting the IsEnabled setting to false using designer.Context.Services.GetService<DesignerView>().IsEnabled = false;
    This gave me what I was after except that the scroll bar was also disabled when meant that the user couldn't see the whole workflow.

    Is there any way of disabling the designer and still having the scroll bar enabled? If not is there any other way of showing a read only workflow designer?

    Cheers

    Matt
    Friday, February 5, 2010 10:03 PM

All replies

  • you can add this code when you load your designer in rehost app

    designer.Context.Items.GetValue<ReadOnlyState>().IsReadOnly = true;

    designer means WorkflowDesigner

     

     

    • Proposed as answer by Ye Yu - MSFT Friday, February 5, 2010 10:44 PM
    Friday, February 5, 2010 10:43 PM
  • Ye,

    Thanks for that. That looks good except that I have some custom activity designers which use combo boxes. When the designer is read only these combo boxes are still editable. Is there something I have to do on the activities to ensure that these are not editable when the designer is read only?

    Cheers
    Sunday, February 7, 2010 8:33 PM
  • what do you mean the combo boxes are still editable?
    if you modify the value, will the value be saved to model properties?
    Sunday, February 7, 2010 11:15 PM
  • if you are talking about your own custom user control, when you adding that control to your activitydesigner, you need to get the readonly state, and set your own usercontrol to readonly mode.
    Monday, February 8, 2010 8:17 PM
  • Ok, thanks for that.

    In the end I went with just disabling the workflow designer and then placing the designer inside a ScrollView component. This delivered what I was after and in my opinion is a much nicer readonly view rather than what is provided by setting the IsReadOnly to true - i.e. it looked less "editable".

    Cheers

    Wednesday, February 10, 2010 3:42 AM
  • How to make the custom user control (in my custom ActivityDesigner) go to readonly when the Designer is read only and go to non-readonly when the designer is not readonly?
    Tuesday, January 25, 2011 7:45 AM
  • Hi Louis,
    I think one way is that you could register to ContextItemManager.Subscribe() (off of EditingContext.Items) http://msdn.microsoft.com/en-us/library/ee425855.aspx to be notified of changes of the ReadOnlyState context item, and use this to update a property or attached property which you bind your controls to.
    Tim

    Wednesday, January 26, 2011 3:37 AM
    Moderator