mui
mui copied to clipboard
Refreshing the page makes UserControl to trigger events twice
For example, there's a ListBox in our view:
<ListBox ItemsSource="{Binding SomeCollection}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<cmd:EventToCommand Command="{Binding SomeCommand,
Mode=OneWay}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"></TextBlock>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Before refreshing the page SelectionChanged event is raised one time if we select a new item, but after refreshing the page via F5 selecting the item raises SelectionChanged event twice.