具有特定展开\折叠行为的自定义活动设计器
我正在尝试为具有展开/折叠功能的自定义 WF4 活动创建一个设计器,该活动具有以下特征:
- 首次添加到工作流设计器(Visual Studio 设计器不是自定义设计器)时,应折叠该活动。
- 当双击活动时,无论它是展开还是折叠,设计者都应该以展开时的“单活动模式”打开它。
我有一个设计器版本,其灵感来自于: http://xhinker.com /2010/03/16/WF4CreateACustomActivity.aspx 但活动设计器的行为并不符合我的要求。 如果我使用:
第二个特征符合预期,但第一个特征显然不是,因为当第一个特征时在工作流设计器中添加的活动以展开的形式呈现。 我尝试将 ShowExpanded 值设置为 false,但第二个条件不行,VS 设计器在双击活动时将其打开为折叠状态。
有什么方法可以实现满足这两个条件的活动设计者吗?
另外,如果我能找出是否有一种方法可以“保留”自定义活动的视图状态(展开或折叠),那么当包含工作流定义上次时该活动是否折叠(或展开),这对我来说也很棒是否被视为以折叠方式打开(或按大小写展开)?
I am trying to create a designer for a custom WF4 activity with the Expand/Collapse ability with the following characteristics:
- when first added to the workflow designer (Visual Studio designer not a custom one) the activity should be collapsed.
- when double clicked on the activity, regardless if it is expanded or collapsed, the designer should open it in the "single activity mode" as expanded.
I have a version of the designer inspired from the one presented in: http://xhinker.com/2010/03/16/WF4CreateACustomActivity.aspx but the activity designer does not behaves as I would want.
If I am using: <DataTrigger Binding="{Binding Path=ShowExpanded}" Value="true">
the second characteristic is as expected but the first one obviously it isn't because when first added in the workflow designer the activity is present as expanded.
I tried to set the ShowExpanded value on false but then the second condition is not OK, the VS designer opening my activity as collapsed when double clicking on it.
Is there any way in which an activity designer fulfilling both conditions, would be possible to be implemented?
Also it would be great for me to find out if there is a way to "persist" the view state(Expanded or Collapsed) of a custom activity, so if the activity was collapsed (or expanded) when the containing workflow definition was last time viewed to be opened as collapsed (or expanded by case)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
至于你的最后一个问题,你可以使用 ViewStateService 将视图状态信息存储在工作流 XAML 文件中。
至于你的第一个问题,我相信如果在 xaml 中设置ExpandState 为
false
。老实说,有点难以理解您不满意的工作流程设计器究竟发生了什么......As for your last question, you can use the ViewStateService to store view state information in the workflow XAML file.
As for your first question, I believe you can force the activity to be collapsed on drop if, in the xaml, you set ExpandState to
false
. Honestly, it is a little hard to understand what exactly is going on with your workflow designer that you're not happy with...