在SilverLight 3 + Sketchflow中使用样式设置器上的绑定 [英] Using bindings on style setters in SilverLight 3 + Sketchflow

查看:57
本文介绍了在SilverLight 3 + Sketchflow中使用样式设置器上的绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SilverLight 3 + Sketchflow为我的客户端创建一个演示。


我正在设计一个ComboBox,并且我希望使用Setter来设置将ComboBox的Tag绑定到它自己的Items.Count属性。


这是我在样式中使用的语法。


< Setter Property =" Tag" Value =" {Binding Path = Items.Count,RelativeSource = {RelativeSource Self}}" /> 


It在Blend 3 WPF应用程序中正常工作,但SL应用程序中断


我从解析器中收到以下错误:


"灾难性故障(来自HRESULT的异常:0x8000FFFF(E_UNEXPTECTED))"


我已经能够找到一些帖子暗示SL3不支持在setter中绑定的想法。  任何人都可以验证这一点或提供解决方案的任何想法吗?如果不支持,有人知道SL4或未来版本是否计划支持
这个?


 

解决方案

在Blend4中禁用样式上的数据绑定,因为它不受支持。


您可以在控件模板(或客户控件)上实现数据绑定而不是造型


I'm using SilverLight 3 + Sketchflow to create a demo for my client.

I'm Styling a ComboBox and in the style I want to use a Setter to bind the Tag of the ComboBox to it's own Items.Count property.

This is the syntax I'm using in the style.

<Setter Property="Tag" Value="{Binding Path=Items.Count, RelativeSource={RelativeSource Self}}"/>

It works fine in a Blend 3 WPF app, but breaks in the SL app

I get the following error from the parser:

"Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPTECTED))"

I've been able to find some posts that allude to the idea that SL3 doesn't support binding in setters.  Can anyone verify this or provide any ideas toward a solution? If it is not supported, does anyone know if SL4 or future versions plan to support this?

 

解决方案

databinding on style is disable in Blend4 because it is not supported.

You may implement databinding on control template (or custome control) instead of styling


这篇关于在SilverLight 3 + Sketchflow中使用样式设置器上的绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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