That is no solution since the trigger would never fire again -_-
I do need that trigger! And I need it to fire ehenever somebody selects an item of that listbox, but not twice after clearing the box.
Using a condition that terminates the trigger when the selected index is 0 doesn't work, because of threading I guess. When the condition is executed, the selected value is already 1 again...
I am using a ListBox and have a trigger set up for it that uses the SelectionChanged Event.
This is what I do: 1. Clear all items in the LB 2. Add new items 3. Select first item
The trigger allways fires twice, both time thinking the selected index is 1 (I know the index gets set to 0 once you clear).
How can I stop the trigger from firing twice?
Thanks for the help, elunder
@elunder: Go
Add a Turn Current Trigger Off action on your trigger.
That is no solution since the trigger would never fire again -_-
I do need that trigger! And I need it to fire ehenever somebody selects an item of that listbox, but not twice after clearing the box. Using a condition that terminates the trigger when the selected index is 0 doesn't work, because of threading I guess. When the condition is executed, the selected value is already 1 again...
Turn the trigger off, wait a small amount of time (this is needed because events dont fire instantly) and re-enable it.