如何为自定义活动属性提供自定义表达式编辑器 [英] how to provide custom expression editor for custom activity property

查看:162
本文介绍了如何为自定义活动属性提供自定义表达式编辑器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

>

> 我想为带有按钮的自定义活动属性提供自定义表达式编辑器.在单击按钮时,它应该 打开对话框窗口,从对话框窗口中选择值时,值应出现在表达式编辑器中.

I want to provide a custom expression editor for my custom activity property with button on it. on click of button it should open the dialog window and on selection of value from dialog window value should be come in expression editor.

>  请建议我,我如何实现这一目标

 

推荐答案

嗨Naveen,

Hi Naveen,

您可以创建源自PropertyValueEditor的自定义编辑器.

You can create custom editor that is dervied from PropertyValueEditor.

这将是单独的xaml文件,文件后面带有代码.

It will be seperate xaml file with code behind file.

在派生类集的构造函数中

In the constructor of derived class set

this .InlineEditorTemplate = System.Windows . 应用程序 .Current.FindResource(COLLECTIONBROWSER) as DataTemplate ;

this.InlineEditorTemplate = System.Windows.Application.Current.FindResource(COLLECTIONBROWSER) as DataTemplate;

和 覆盖方法

and override method

public 覆盖 void ShowDialog( 属性值 propertyValue IInputElement commandSource)

public override void ShowDialog(PropertyValue propertyValue, IInputElement commandSource)

  a 数据模板.您可以创建自己的数据模板.

where COLLECTIONBROWSER is   a datatemplate . you can create your own data template .

< x : ="CollectionBrowser"> < >

<DataTemplate x:Key ="CollectionBrowser"> <Grid.ColumnDefinitions>

< >

< 宽度 =" 1 *"/> < ColumnDefinition <一个rel ="nofollow"> 宽度   </ Grid.ColumnDefinitions >   PE : EditModeSwitc hButton ="1"/>   </ 网格 >   DataTemplate

<ColumnDefinition Width ="1*"/><ColumnDefinition Width "Auto"/> </Grid.ColumnDefinitions >  <PE:EditModeSwitchButton Grid.Column ="1"/> </Grid> </DataTemplate>

  < Grid.Column ="0" 文本 =""{ 绑定 }''//gt;

 <TextBox Grid.Column="0" Text="{Binding StringValue }"/>

 

对于 更多细节请看这里.

For more details look here.

我 希望对您有帮助 span>

I hope this help you


这篇关于如何为自定义活动属性提供自定义表达式编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆