I need a help to solve an intrinsic problem with the EventToCommand (or the binding in general). Suppose I have a MainView and a MainViewModel. The MainView has a ListBox like this one:
If I set SelectedPerson = null by code (because i want to clear the selection in the listbox) the trigger fires but the CommandParameter is not updated yet and command receive the old value. I can see that the CommandParameter get updated
after the command is executed. The same happen if I bind the CommandParameter directly to the SelectedPerson property of the ViewModel
In this simple case I could workaround the problem by not passing the value through the command parameter and getting the value in the viewmodel code, but I have a dynamic number of listbox binded to the same command and the CommandParameter become
Is there a way to control the order in which Triggers and Bindings are executed ?