Combobox : EventTriggerBehavior SelectionChanged is triggered before the SelectedItem
See original GitHub issueHello,
In a mvvm combobox, the EventTriggerBehavior SelectionChanged is triggered before the SelectedItem
<ComboBox x:Name="cmbMainLang"
assists:ComboBoxAssist.Label="{Binding Hint}"
PlaceholderText="{Binding Hint}"
MaxDropDownHeight="200"
Margin="0 40 0 0"
DataContext="{Binding UILanguagesComboBox}"
Items="{Binding Items}"
SelectedItem="{Binding Selected}">
<Interaction.Behaviors>
<EventTriggerBehavior EventName="SelectionChanged">
<InvokeCommandAction Command="{Binding SelectCommand}"/>
</EventTriggerBehavior>
</Interaction.Behaviors>
</ComboBox>
This lead to an unsynchonized combobox value & command
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
ComboBox SelectedItem binding updates after ...
Since the name of the EventTriggerBehavior is SelectionChanged, the event should be triggered after the selection has been changed (or has been ...
Read more >Combobox selectionchanged event triggers without even ...
After that everything works perfectly, I wonder what triggers the ComboBox SelectionChanged Event before even loading the window.
Read more >How to trigger SelectionChanged event when ComboBox ...
I want to open that different window again and again by selecting the last item it does not matter if I select the...
Read more >How to get SelectedItem in the ComboBox?
I've another Custom Control, Combo which is an extended ComboBox, and it raises SelectionChanged whenever I change selection.
Read more >How can I prevent SelectionChanged event for a ...
One strategy is to structure your code so that it doesn't matter. For example let's say changing the combo box selection populates a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Of course 😃 thanks a lot for the confirmation
I would not call it workaround, more like correct solution to what Avalonia framework currently does.