工作流程 4 活动设计器 IValueConverter
假设我有一个与 InArgument
我想在活动设计器中公开一个组合框来显示所有产品,并且用户可以选择一个产品。
我可以毫无问题地显示组合中的产品列表。但是我如何将所选产品绑定到 InArgument
我想我需要某种 ValueConverter 吗?不知道如何为这种情况编写值转换器,如果有人有想法、建议,将会有所帮助。我必须将 InArgument
谢谢,
Lets say i have an activity with InArgument<int> ProductId
I'd like to expose in the activity designer a combobox to show all Products and the user can select a product.
I can show the list of product in the combo no problem. But how do I bind the selected product to the InArgument<int> of my custom activity?
I suppose I need some kind of ValueConverter? Not sure how to code the value converter for this case, if anybody has an idea, suggestion, will be helpful. I have to convert the InArgument<int> to an int? and the convert back from int to InArgument<int>
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
修改自此回答
Modified from this answer
这是我尝试为此制定一个更通用的解决方案。我有几个属性 - 一些 IEnumerable、一些字符串、一些 int,并且为每个属性创建一个值转换器似乎是错误的方法。我很想知道我在这里没有发现哪些案例,因为我对 WF 比较陌生。希望这对某人有帮助。
This is my attempt at making a more generic solution to this. I have several properties - some IEnumerable, some string, some int, and to make a value converter for each seems like the wrong approach. I'd be interested to know what cases I haven't caught here because I am relatively new to WF. Hopefully this helps someone.