Exemple #1
0
        public static void SetUp(this Entry entry, Action action)
        {
            if (alreadySetUp.ContainsKey(entry))
            {
                entry.TextChanged -= alreadySetUp[entry].OnTextChanged;
            }

            var evt = new EntryTextChanged()
            {
                Action = action
            };

            entry.TextChanged  += evt.OnTextChanged;
            alreadySetUp[entry] = evt;
        }
        private void EntryBoxTextChanged(object sender, TextChangedEventArgs e)
        {
            if (m_blockEntryBoxTextChanged)
            {
                return;
            }

            SelectedItem = null;

            EntryTextChanged?.Invoke(this, new RoutedEventArgs());

            if (!ItemsSource.Any() || String.IsNullOrWhiteSpace(EntryBox.Text))
            {
                SuggestionPopup.IsOpen = false;
            }
            else if (!m_blockPopup)
            {
                SuggestionPopup.IsOpen = true;
            }
        }