locked
Influence variables button behaviour (Beta 2) RRS feed

  • Question

  • Hello,

    In Beta 1, I asked about the ability to change the buttons in the activity designer.  I was told that in Beta 2, the ability to not add the Variables and Arguments button will be enabled for the designer.  Please see this earlier post for more details.

    Now that Beta 2 is available, I'm wondering how to avoid adding the Variables and Arguments buttons in the designer, and if any of the other scenarios discussed in the original post are now possible (such as adding my own buttons).  I would also like some more information about  replacing the default expression editor with a more sophisticated editor, as mentioned in Matt's reply to my question.

    Thank you,

    Notre
    Monday, November 2, 2009 5:36 PM

Answers

  • this

     

    .wd.Context.Services.GetService<DesignerView>().WorkflowShellBarItemVisibility = ShellBarItemVisibility.Variables;

    You can use the ShellBarItemvisbility enum values to hide/unhide each of the buttons.

    Thanks,
    kushal.


    Kushal Shah - This posting is provided "AS IS" with no warranties, and confers no rights
    • Marked as answer by Scott Mason - MSFT Tuesday, November 3, 2009 9:33 PM
    • Unmarked as answer by Notre Wednesday, November 4, 2009 12:31 AM
    • Marked as answer by Notre Thursday, November 5, 2009 5:23 PM
    Monday, November 2, 2009 7:54 PM

All replies

  • this

     

    .wd.Context.Services.GetService<DesignerView>().WorkflowShellBarItemVisibility = ShellBarItemVisibility.Variables;

    You can use the ShellBarItemvisbility enum values to hide/unhide each of the buttons.

    Thanks,
    kushal.


    Kushal Shah - This posting is provided "AS IS" with no warranties, and confers no rights
    • Marked as answer by Scott Mason - MSFT Tuesday, November 3, 2009 9:33 PM
    • Unmarked as answer by Notre Wednesday, November 4, 2009 12:31 AM
    • Marked as answer by Notre Thursday, November 5, 2009 5:23 PM
    Monday, November 2, 2009 7:54 PM
  • Hi Kushal,

    Thank you for taking the time to reply to my question.

    I'm not sure I fully follow the answer.  I took the rehosting sample code and modified it slightly like so:


     protected override void OnInitialized(EventArgs e)
            {
                base.OnInitialized(e);
                // register metadata
                (new DesignerMetadata()).Register();

                // create the workflow designer
                WorkflowDesigner wd = new WorkflowDesigner();
                System.Workflow.ComponentModel.Design.DesignerView wdDesignerView = wd.Context.Services.GetService<System.Workflow.ComponentModel.Design.DesignerView>();

    I don't know if I have the right DesignerView class.  The one I found in the System.Workflow.ComponentModel.Design namespace does not expose a WorkflowShellBarItemVisibility property.  What am I doing wrong?

    Thanks,

    Notre

    Tuesday, November 3, 2009 5:33 PM
  • Hi Kushal,

    Ok, I see what I was doing wrong.  I should have used the DesignerView in the System.ActivitSystem.Activities.Presentation.Viewies.Presentation.View namespace.  So, your code segment works fine to hide/show each of the buttons.

    I unmarked the question as an answer, but because it didn't fully answer my questions.  It answered one of my questions, which was how to hide the existing buttons visibility.  But it didn't answer the question as to whether it is possible to:

    - add my own button to the designer?
    - alter the behaviour so that when the Variables button is pressed, I bring up my own editor/dialog instead of the built in WF variables editor?
    - override the behaviour of the various parts of the variables editor:
       e.g. - can I customize the variable type drop down editor?
       e.g. - can I change the "default" expression editor (and possibly remove it)?

    If you don't know the answer to these questions, or only some of them, I will start a new question thread(s) to ask the other questions.

    Thanks,

    Notre
    Wednesday, November 4, 2009 12:39 AM
  • Ok, I will create separate forum posts for each of my questions.  I'll remark your response as an answer, to the question about whether I can hide existing buttons on the workflowshell.

    Notre
    Thursday, November 5, 2009 5:23 PM