diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Controls/SearchComboBox.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Controls/SearchComboBox.cs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/SearchComboBox.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/SearchComboBox.cs index 011087d54..010175e0c 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Controls/SearchComboBox.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Controls/SearchComboBox.cs @@ -219,6 +219,10 @@ namespace Tango.SharedUI.Controls { e.Handled = true; + var presentationSource = PresentationSource.FromVisual(_listBox); + + if (_listBox == null || System.Windows.Input.Keyboard.PrimaryDevice == null || presentationSource == null) return; + if (!_listBox.IsFocused) { FocusList(); @@ -229,13 +233,13 @@ namespace Tango.SharedUI.Controls _listBox.RaiseEvent( new KeyEventArgs( System.Windows.Input.Keyboard.PrimaryDevice, - PresentationSource.FromVisual(_listBox), 0, Key.Up) + presentationSource, 0, Key.Up) { RoutedEvent = System.Windows.Input.Keyboard.KeyDownEvent }); _listBox.RaiseEvent( new KeyEventArgs( System.Windows.Input.Keyboard.PrimaryDevice, - PresentationSource.FromVisual(_listBox), 0, Key.Up) + presentationSource, 0, Key.Up) { RoutedEvent = System.Windows.Input.Keyboard.KeyUpEvent }); } else @@ -243,13 +247,13 @@ namespace Tango.SharedUI.Controls _listBox.RaiseEvent( new KeyEventArgs( System.Windows.Input.Keyboard.PrimaryDevice, - PresentationSource.FromVisual(_listBox), 0, Key.Down) + presentationSource, 0, Key.Down) { RoutedEvent = System.Windows.Input.Keyboard.KeyDownEvent }); _listBox.RaiseEvent( new KeyEventArgs( System.Windows.Input.Keyboard.PrimaryDevice, - PresentationSource.FromVisual(_listBox), 0, Key.Down) + presentationSource, 0, Key.Down) { RoutedEvent = System.Windows.Input.Keyboard.KeyUpEvent }); } //base.OnPreviewMouseWheel(e); |
