locked
CustomExpression value not updating on workflow rehosted Designer RRS feed

  • Question

  • Hi,

    When I am adding condition to IFElse activity using custom expression editor, Value(Condition) is updating in Property Grid.  But  same Value(Condition) is not showing/updating on IFElse activity Rehosted workflow designer. 

    Selection selected1 = this.WorkflowDesignerControl.Context.Items.GetValue<Selection>();

     

    ModelItem modelItem1 = selected1.PrimarySelection;

     

    Argument ArgCondition = Argument.Create(typeof(bool), ArgumentDirection.In);

     

    ArgCondition.Expression = new Microsoft.VisualBasic.Activities.VisualBasicValue<bool>

    {

              ExpressionText = "1=1"

    };

     

    modelItem1.Properties["Condition"].SetValue(ArgCondition);

     //To Update the value in Property grid

    OnSelectionChangedMethod.Invoke(WorkflowDesignerControl.PropertyInspectorView, new object[] { selected1 });

     

    RefreshMethod.Invoke(WorkflowDesignerControl.PropertyInspectorView, new object[] { false });

    //To Update the value(Condition) in workflow designer.

    WorkflowDesignerControl.View.UpdateLayout();

    But this is not working. IfElse activity condition not showing in rehosted designer.

    Tuesday, December 7, 2010 11:39 AM

All replies

  • There's 3 parts involved here

    1) the ModelItem

    2) the property grid view

    3) the designer view

    The first bit of code to me looks like it should update #1 correctly. And when you update #1, #2 and #3 should update automatically, although it depends on how you implemented them.

    I really don't understand what the other bits of code you post are meant to do or how they would work, but I would guess the problem is with them.

    You said you are using a custom expression editor. Does it use WPF Binding, or some other mechanism? If you are not using WPF Binding, I would still recommend your control be triggered to refresh in similar way based upon notifications from ModelItem's IPropertyChanged interface.

    Tim

    • Marked as answer by Andrew_Zhu Tuesday, December 14, 2010 2:10 AM
    • Unmarked as answer by MeetHanu Monday, December 27, 2010 6:36 AM
    Tuesday, December 7, 2010 6:06 PM