【发布时间】:2013-01-09 21:56:54
【问题描述】:
这是ComboBoxItemTemplate:
<DataTemplate x:Key="DataTemplate2">
<Grid Background="AliceBlue" Height="30">
<TextBlock Text="{Binding Content}" Foreground="Lime"></TextBlock>
</Grid>
</DataTemplate>
我想在上面的TextBlock 处使用Texblock.TextTrimming。这个TextBlock 将是屏幕上的ComboBoxItem,但我不知道在TextBlockText 上放什么。我应该绑定什么?
我通常会看到他们放置的示例:Text={Binding CustomClass.CustomProperty},但我需要使其通用。所以它适用于应用程序的每个ComboBox。
我可以在 Text 中添加什么内容?
拜托,我尝试了 4 个小时。
【问题讨论】:
标签: c# .net wpf combobox itemtemplate