Inheritance: System.Windows.RoutedEventArgs
Exemple #1
0
        private void autocompleteTextBox_Closed(object sender, CloseEventArgs e)
        {
            if (e.IsCommit)
            {
                if (CanAutocomplete())
                { 
                    object value = Server.Convert(autocompleteTextBox.SelectedItem, Type);

                    if (value != null)
                    {
                        IList list = EnsureEntities();
                        list.Add(value);
                        SetEntityUserInteraction(value);
                    }
                }

                autocompleteTextBox.Text = "";
                autocompleteTextBox.SelectEnd();
            }
            else
            { 
            }
        }
 public bool Close(CloseReason reason)
 {
     pop.IsOpen = false;
     if (SelectedItem.TryToString() != txtBox.Text)
     {
         if (string.IsNullOrEmpty(txtBox.Text))
             SelectedItem = null;
         else if (AllowFreeText)
             SelectedItem = txtBox.Text;
     }
     var args = new CloseEventArgs(reason);
     RaiseEvent(args);
     return args.Handled;
 }
Exemple #3
0
        private void autocompleteTextBox_Closed(object sender, CloseEventArgs e)
        {
            if (e.IsCommit)
            {
                if (CanAutocomplete())
                    SetEntityUserInteraction(Server.Convert(autocompleteTextBox.SelectedItem, Type));

                autocompleteTextBox.Visibility = Visibility.Hidden;
                cc.Focus();
            }
            else
            {
                if (e.Reason != CloseReason.LostFocus)
                    autocompleteTextBox.Visibility = Visibility.Hidden;
            }
        }