我有一個問題,運行的綁定不起作用。 這是我目前的代碼。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