private void AddUser_Click(object sender, RoutedEventArgs e) { if (NameUserTextBox.Text.Trim().Length < 1) { MessageBox.Show("Введите значение в текстовое поле!"); return; } viewModel.AddItem(NameUserTextBox.Text); NameUserTextBox.SetBinding(TextBox.TextProperty, new Binding("V") { Source = new object() }); NameUserTextBox.Text = ""; AddButton.Content = "+"; res = true; }