0
我是XAML世界的新手,我正在通过大量教程摸索自己的方式。我坚持的一件事就是在对象上调用.tostring。ContentControl中的XAML tostring
这里是mysetup
我有被绑定到对象 列表我有绑定到从列表框中显示所选择的项目相同的列表中的一个ContentControl中列表框。
我ContentControl中如下:
<ContentControl Grid.Row="1" Margin="0,3,5,204" Name="Detail"
Content="{Binding Source={StaticResource listingDataView}}"
ContentTemplate="{StaticResource myContentTemplate}"
HorizontalAlignment="Right" Width="231"/>
在myContentTemplate我:
<DataTemplate x:Key="myContentTemplate">
<StackPanel>
<TextBlock Text="{Binding Path=Name}" />
<!-- want to call .tostring here-->
</StackPanel>
</DataTemplate>
在模板我想打电话的ToString当前选择的对象,但我不能弄清楚如何做到这一点?
感谢 斯蒂芬