如何在自定义 silverlight 行为上创建属性,以便表达式混合将显示对象选择器?
我已经使用目标控件属性创建了自定义行为,但我无法弄清楚如何混合以显示圆形“对象选择器”,以便我可以拖放以定位特定控件。因此,当我创建这样的行为时:
public class SetFocusAfterBusyBehavior : Behavior<BusyIndicator>
{
public object TargetControl { get; set; }
当我尝试在混合中设置 TargetControl 属性时,我只会得到一个没有对象选择器的框。
我尝试将 TargetControl 更改为依赖属性。我查看了反射器中的 TargetedTriggerAction 类,看看是否可以弄清楚是否存在特殊属性。我还在网上浏览并阅读了此 博客 没有具体提到对象选择器,而且似乎比必要的工作多了很多。
有一个简单的解决方案吗?我对 silverlight 和 Blend 还很陌生,所以也许我错过了一些非常简单的东西。
I've created a custom behavior with a target control property and I can't figure out how to get blend to display the round "object picker" so that I can drag and drop to target a particular control. So when I create a behavior like this:
public class SetFocusAfterBusyBehavior : Behavior<BusyIndicator>
{
public object TargetControl { get; set; }
When I try to set the TargetControl property in blend I just get a box with no object picker.
I've tried changing TargetControl to be a dependency property. I've looked at the TargetedTriggerAction class in reflector to see if I could figure out how if there is a special attribute. I also poked around on the web and read this blog which doesn't specifically mention the object picker and also seems like a lot more work than should be necessary.
Is there a simple solution to this? I'm pretty new to silverlight and blend so perhaps I'm missing something very simple.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将
System.Windows.Interactivity
程序集中的CustomPropertyValueEditorAttribute
与CustomPropertyValueEditor
枚举中的值之一结合使用,以访问一些提供的属性编辑器。You can use the
CustomPropertyValueEditorAttribute
from theSystem.Windows.Interactivity
assembly in combination with one of the value from theCustomPropertyValueEditor
enumeration, to get access to some of the provided property editors.