2
我想添加验证,并从编译器获得以下内容。Silverlight 3 ValidatesOnException找不到
在'绑定'类型中找不到'ValidatesOnException'属性。 属性'ValidatesOnException'在XML命名空间'http://schemas.microsoft.com/winfx/2006/xaml/presentation'的类型'Binding'中不存在。
我尝试在System.Windows中添加System.Windows.Data作为xmlns,但没有运气。
以下是我对标记的尝试。
<TextBox x:Name="Office" Style="{StaticResource PhoneNumber}">
<TextBox.Text>
<Binding Path="Office" Mode="TwoWay" NotifyOnValidationError="true" ValidatesOnException="true" Converter="{StaticResource PhoneNumberConverter}" />
</TextBox.Text>
</TextBox>
<TextBox x:Name="Office" Style="{StaticResource PhoneNumber}" Text="{Binding Office, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnException=true, Converter={StaticResource PhoneNumberConverter}}" />
任何想法?
旧的受害者“盯着它工具长”。这很有趣,我甚至认为拼写可能是一个问题,并从Jesse Liberty的例子中复制出来。 - 谢谢!! – PretzelSteelersFan 2009-11-03 19:04:53