I’m trying to set a default selected value when ItemsSource property changes on my ComboBox
My xaml :
<ComboBox ItemsSource="{Binding SelectedItemsSource, Mode=OneWay}" x:Name="c1">
<i:Interaction.Triggers>
<ei:PropertyChangedTrigger Binding="{Binding ItemsSource,RelativeSource={RelativeSource Self}}">
<ei:ChangePropertyAction PropertyName="SelectedIndex" Value="{StaticResource zero}" TargetName="c1"/>
</ei:PropertyChangedTrigger>
</i:Interaction.Triggers>
</ComboBox>
The SelectedItemsSource in my VM changes dynamically and I want to have the first item selected each time this happens .
Any idea why this doesn’t work?
Try setting property IsSynchronizedWithCurrentItem to
truefor your combobox and remove the trigger completely –