diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-12 13:17:41 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-12 13:17:41 +0200 |
| commit | a98e30ab93fd4717bbe49c0b2cb6dff4bc65a67c (patch) | |
| tree | 5b50d3ff60da99eedc1aad14af8e526539ed2c15 /Software/Visual_Studio/Tango.Touch/Controls/TouchAutoComplete.cs | |
| parent | 739fd56662cdee59f42ec8d80654babf158b9f51 (diff) | |
| download | Tango-a98e30ab93fd4717bbe49c0b2cb6dff4bc65a67c.tar.gz Tango-a98e30ab93fd4717bbe49c0b2cb6dff4bc65a67c.zip | |
Working on PPC color catalog.
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Controls/TouchAutoComplete.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Controls/TouchAutoComplete.cs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchAutoComplete.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchAutoComplete.cs index da5b44fa6..fd8f17367 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchAutoComplete.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchAutoComplete.cs @@ -107,7 +107,7 @@ namespace Tango.Touch.Controls public TouchAutoComplete() { - AutoCompleteProvider = new AutoCompleteProvider<Object>((obj, filter) => { return obj.ToString().ToLower().StartsWith(filter.ToLower()); }); + //AutoCompleteProvider = new AutoCompleteProvider<Object>((obj, filter) => { return obj.ToString().ToLower().StartsWith(filter.ToLower()); }); ItemSelectedCommand = new RelayCommand(() => OnSelectedItemChanged()); } @@ -136,6 +136,18 @@ namespace Tango.Touch.Controls private void _textBox_LostFocus(object sender, RoutedEventArgs e) { _popup.IsOpen = false; + + if (EffectiveItemsSource != null && EffectiveItemsSource.Count > 0 && SelectedItem == null) + { + SelectedItem = EffectiveItemsSource[0]; + + var binding = BindingOperations.GetBindingExpressionBase(this, SelectedItemProperty); + + if (binding != null) + { + binding.UpdateSource(); + } + } } private void _textBox_GotFocus(object sender, RoutedEventArgs e) @@ -152,6 +164,9 @@ namespace Tango.Touch.Controls { EffectiveItemsSource = AutoCompleteProvider.Filter(ItemsSource, Text); + SelectedItem = null; + + if (EffectiveItemsSource.Count > 0) { _popup.IsOpen = true; |
