我有一个问题,就是Run的绑定不起作用。这是我的当前代码。
<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>