private void addContentToWhereClause(string content)
        {
            if (WhereClauseTB.Text == "")
            {
                WhereClauseTB.Text = content;
            }
            else
            {
                WhereClauseTB.SelectedText = " " + content + " ";
            }
            Dispatcher.BeginInvoke((ThreadStart) delegate
            {
                WhereClauseTB.Focus();

                WhereClauseTB.SelectionStart = WhereClauseTB.Text.Length;
                //Keyboard.Focus(WhereClause);
            });
        }
        private void FieldItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            string fieldName = (sender as ListBoxItem).Content.ToString();

            if (WhereClauseTB.Text == "")
            {
                WhereClauseTB.Text = fieldName;
            }
            else
            {
                WhereClauseTB.SelectedText = " " + fieldName + " ";
            }
            Dispatcher.BeginInvoke((ThreadStart) delegate
            {
                WhereClauseTB.Focus();

                WhereClauseTB.SelectionStart = WhereClauseTB.Text.Length;
                //Keyboard.Focus(WhereClause);
            });
        }