1
我目前使用WPF .NET 3.5开发,使用ikriv的数学转换,我决定做一个数学问题在我的设计:在XAML绑定,XAML解析异常
<ControlTemplate x:Key="RectangleTemplate">
<Grid Background="Transparent">
<Rectangle x:Name="Shape" Stroke="#d69e31" Fill="{StaticResource YellowGradientBrush}">
<!-- Create a rectangle that applies Cornering accoding to it's (in form) indicated height -->
<Rectangle.RadiusX>
<MultiBinding Converter="{StaticResource MathConverter}" ConverterParameter="x/2.5">
<!-- Error occurs in the line below -->
<Binding Path="Object" ElementName="{TemplateBinding Property=Button.Height}" />
</MultiBinding>
</Rectangle.RadiusX>
<Rectangle.RadiusY>
<MultiBinding Converter="{StaticResource MathConverter}" ConverterParameter="x/2.5">
<!-- Error occurs in the line below -->
<TemplateBinding Property="Button.Height" />
</MultiBinding>
</Rectangle.RadiusY>
</Rectangle>
</Grid>
</ControlTemplate>
+异常协助说:
的InnerException:System.InvalidCastException
消息=无法转换类型 'System.Windows.TemplateBindingExpression' 的目的为类型 'System.String'。
谢谢。
是的,有一个错误那条线。请给出一些关于你想要绑定的信息。 – 2012-02-29 18:33:50