locked
Rehosted Designer Binding Issues RRS feed

  • Question

  • Hello,

    I'm working with the latest Windows Workflow Foundation and I'm rehosting the designer. I've browsed around and looked into samples however I keep getting some binding errors that I have no idea how to solve. This is what I get in output:

    System.Windows.Data Error: 40 : BindingExpression path error: 'ToolboxItem' property not found on 'object' ''ToolboxItemWrapper' (HashCode=16945151)'. BindingExpression:Path=ToolboxItem.DisplayName; DataItem='ToolboxItemWrapper' (HashCode=16945151); target element is 'TreeViewItem' (Name=''); target property is 'Name' (type 'String')

    System.Windows.Data Error: 1 : Cannot create default converter to perform 'one-way' conversions between types 'System.Collections.ObjectModel.Collection`1[System.Activities.Activity]' and 'System.Activities.Presentation.Model.ModelItemCollection'. Consider using Converter property of Binding. BindingExpression:Path=ModelItem.Activities; DataItem='SequenceDesigner' (Name=''); target element is 'WorkflowItemsPresenter' (Name=''); target property is 'Items' (type 'ModelItemCollection')

    To my understanding the 2nd error tells that I need to provide a convertor for a binding however I am not making any bindings. I just create the WorkflowDesigner and load a new Sequence instance. I do this in the constructor:

    public U4SWorkflowDesignerUserControl()
      {
       InitializeComponent();

       (new DesignerMetadata()).Register();

       _workflowDesigner = new WorkflowDesigner();
       _workflowDesigner.Load(new Sequence());

       _toolboxControl = new ToolboxControl();
       ToolboxCategory toolboxCategory = new ToolboxCategory("Test");
       toolboxCategory.Add(new ToolboxItemWrapper(typeof(Sequence)));
       _toolboxControl.Categories.Add(toolboxCategory);

       Grid.SetColumn(_workflowDesigner.View, 2);

       grid1.Children.Add(_toolboxControl);
       grid1.Children.Add(_workflowDesigner.View);
      }

    If I comment the line with (new DesignerMetadata()).Register(); I receive no binding errors however that makes the designer useless since I cannot edit anything.

    Thanks in advance,

    Andrei Fangli

    Tuesday, February 11, 2014 2:38 PM

Answers

All replies