private void ApplyButton_OnClick(object sender, RoutedEventArgs e) { AddButton.Visibility = Visibility.Visible; NameTextBox.Visibility = Visibility.Collapsed; ApplyButton.Visibility = Visibility.Collapsed; CancelButton.Visibility = Visibility.Collapsed; if (CreateCommand != null && CreateCommand.CanExecute(NameTextBox.Text)) { CreateCommand.Execute(NameTextBox.Text); NameTextBox.Text = string.Empty; } }