我有:
<DataTemplate x:Name="_ComboBoxTemplate" x:Key="_ComboBoxTemplate">
<StackPanel Orientation="Horizontal">
<StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock VerticalAlignment="Center" Text="{Binding}" FontSize="24"/>
</StackPanel>
</StackPanel>
</StackPanel>
</DataTemplate>
<ComboBox x:Name="_criteria" ItemTemplate="{StaticResource _ComboBoxTemplate}" ItemsSource="{Binding}"/>
在后面的代码中:
this.DataContext = new string[] { "0", "1", "2", "3", "4", "5" };
我如何得到它,以便默认SelectedItem
为?ComboBox
5