![silverlight列表控件ComboBox 托管代码绑订数据集合 silverlight列表控件ComboBox 托管代码绑订数据集合](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
.xaml
<ComboBox x:Name="myCombobox" Width="300" Height="30">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Width="260" Orientation="Horizontal">
<TextBlock Text="{Binding ID}"/>
<TextBlock Text="."/>
<TextBlock Text="{Binding Name}"/>
<TextBlock Text="("/>
<TextBlock Text="{Binding Count}" Foreground="Red"/>
<TextBlock Text=")"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
.cs
namespace SilverlightApplication2
{
public class Category
{
public int ID { get; set; }
public string Name { get; set; }
public int Count { get; set; }
}
}