我有一个问题,运行的绑定不起作用。 这是我目前的代码。XAML TextBlock和运行绑定
<TextBlock
x:Name="txtCompanyName"
Text="{Binding Path=SelectedItem.CompanyName, ElementName=lbSourceList}"
Foreground="White"
FontSize="18.667"
Height="33.667"
Margin="10,-0.5,0,-1.5">
<Run Text=" : " Foreground="White"/>
<Run Text=" "/>
<Run Text=" " Foreground="White"/>
<Run Text=" "/>
<Run Text="{Binding Path=SelectedItem.RFQID, ElementName=lbSourceList}" />
</TextBlock>
我得到的公司名称出现,但额外的数据永远不会出现。 任何想法为什么这种类型的绑定失败?
备选答案连同最后的答案
<TextBlock TextWrapping="Wrap"
Text="{Binding RFQID}"
FontWeight="Bold"
Foreground="#FFFFF504"
HorizontalAlignment="Left" Width="185">
<Run Text=" ~ "/>
<Run Text="{Binding RFQNo}" FontWeight="Bold" Foreground="#FFFFF504"/>
<Run Text=" ~ "/>
<Run Text="{Binding Status}" FontWeight="Bold"
Foreground="#FF85F35F"/>
</TextBlock>
显示你的[装订错误](http://blogs.msdn.com/b/wpfsldesigner/archive/2010/06/30/debugging-data-bindings-in-a-wpf-or-silverlight-application。 aspx)... – 2012-08-09 11:11:21
谢谢。没有显示任何绑定错误 – scottsanpedro 2012-08-09 11:21:05
自WPF 4.0开始,您可以使用绑定运行 – Chepene 2014-12-16 10:31:34