I asked about this earlier (http://social.msdn.microsoft.com/Forums/vstudio/en-US/7e7a9738-9053-4f50-b29c-d3c066e41d71/wpf-event-handling), but since that was answered that far, I made a new thread for continuation question.
I had to return to this again - this time with a specific problem.
<GridLostKeyboardFocus="SbLostKbFocus"LostFocus="SbLostFocus"GotFocus="SbGotFocus"><Grid.RowDefinitions><RowDefinitionHeight="Auto"/><RowDefinitionHeight="Auto"/></Grid.RowDefinitions><TextBoxGrid.Row="0"Width="Auto"Text="{Binding Path=SuggText}"LostKeyboardFocus="SbTextLostFocus"GotKeyboardFocus="SbFocusText"TextChanged="SbTextChanged"/><ListBoxGrid.Row="1"Width="Auto"IsTextSearchEnabled="true"BorderThickness="1.0"Visibility="{Binding Path=ListOpen}"ItemsSource="{Binding Path=SuggList}"GotKeyboardFocus="SbFocusList"LostKeyboardFocus="SbListLostFocus"SelectionChanged="SbListSelected"LostFocus="SbLostFocus"GotFocus="SbGotFocus"></ListBox></Grid>
When in the ListBox I move between the list entries, I get:
SbFocusList(a list entry is selected)SbListLostFocus(The list entry is left for another list entry - arrow-key)Sb:LostFocusSystem.Windows.Controls.ListBoxSb:LostFocusSystem.Windows.Controls.GridSb:GotFocusSystem.Windows.Controls.ListBoxSb:GotFocusSystem.Windows.Controls.GridSbListSelected:PaavoPipo(new list entry is selected)SbTextChangedSbFocusList
(Console outputs from the event handlers, except the Grid Kb focus)
Why do I "get out and back into" ListBox, when I advance from one ListBox element to another?
Why do I also "get out and back into" the Grid holding the ListBox? (Even if I handle the ListBox-event.)
Is there an event that only triggers if I click somewhere outside the Grid, or
how could I handle the situation?
I'd like to find out, when the user has stopped playing with the contents of the grid.
(Then I can get the final selected item.)