How can I set the default selection of my ComboBox right inside my XAML code? This is what the code of my ComboBox looks like:
<ComboBox Name="ComboBox1" Width="200" Height="30" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10,10,0,0">
<ComboBoxItem>My first item</ComboBoxItem>
</ComboBox>
In my C# code, I always used to set the default value of the ComboBox like this:
ComboBox1.SelectedIndex = 0;
Is it possible to do the same thing in my XAML code?
I hope this will help