Binding data to Combobox in custom activity designer

后端 未结 3 1292
粉色の甜心
粉色の甜心 2021-01-04 12:59

I have a custom activity, with a single in argument which is a string. However, rather than allow the designer to enter an arbitrary string, I want the designer to be presen

3条回答
  •  耶瑟儿~
    2021-01-04 13:24

    Normally, I would write the activity with a property rather than an InArgument. This simplifies the scenario:

    
    

    (here ValidOptions is some Collection property on your ActivityDesigner class. MyStringProperty is some public get/set/ property on the underlying activity such as:

    public string MyStringProperty { get; set; }
    

    )

    The problem you will have if you add InArgument to the mix is that the string values from the combo box cannot be directly assigned to a ModelItem expecting InArgument. This is fixable using a custom IValueConverter in your binding.

提交回复
热议问题