title: How do I clear my TextBox using MVVM after my Command fires
body: <p>I have my MainWindow with a TextBox control on it.</p>
  
  <pre><code>&lt;Grid&gt;
          &lt;TextBox x:Name="messageBox" Margin="252,89,277,300"&gt;
              &lt;TextBox.InputBindings&gt;
                  &lt;KeyBinding Key="Enter"
                              Command="{Binding TextCommand}"
                              CommandParameter="{Binding Text, ElementName=messageBox}"/&gt;
              &lt;/TextBox.InputBindings&gt;
          &lt;/TextBox&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p>And as you can see I have bound the <code>Enter</code> key to when I click Enter it promts a MessageBox with the text I provided in the TextBox.
  My question is.. How do i clear the textbox after I press enter? I don't want to call an Event on the Control because that will defeat the purpose of MVVM, it will also clutter up my MainWindow.cs</p>
  
  <p>As you can see I've set the DataContext in my MainWindow like so..</p>
  
  <pre><code>public partial class MainWindow : Window
  {
      public MainWindow()
      {
          InitializeComponent();
          DataContext = new ServerViewModel();
      }
  }
  </code></pre>
  
  <p>And here is my ServerViewModel.cs</p>
  
  <pre><code>class ServerViewModel : INotifyPropertyChanged
      {
          public TextBoxCommand TextCommand { get; }
          public ServerViewModel()
          {
              TextCommand = new TextBoxCommand(SendMessage);
          }
  
          private void SendMessage(string parameter)
          {
              MessageBox.Show(parameter);
              parameter = "";
          }
  
  
          public event PropertyChangedEventHandler PropertyChanged;
          [NotifyPropertyChangedInvocator]
          protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
          {
              PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
          }
      }
  </code></pre>
  
  <p>And the command if that's worth looking at.</p>
  
  <pre><code>class TextBoxCommand : ICommand
      {
          public Action&lt;string&gt; _sendMethod;
  
          public TextBoxCommand(Action&lt;string&gt; SendMethod)
          {
              _sendMethod = SendMethod;
          }
          public bool CanExecute(object parameter)
          {
              return true;
          }
  
          public void Execute(object parameter)
          {
              _sendMethod.Invoke((string)parameter);
          }
  
          public event EventHandler CanExecuteChanged;
      }
  </code></pre>