title: How to clear text box on click in MVVM
body: <p>I have a textbox and a button I want to clear the contents of textbox on button click. I am using MVVM prism.</p>
  
  <p>My <strong>XAML</strong> is</p>
  
  <pre><code>  &lt;TextBox  Grid.Row="0" Text="{Binding 
         Path=TextProperty,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" Name="txtUserEntry2"/&gt;
  
     &lt;Button Content="Select" 
         Command="{Binding Path=MyCommand}" /&gt;
  </code></pre>
  
  <p>and In my <strong>View Model</strong></p>
  
  <pre><code>    public string TextProperty
      {
  
          get
          {
              return selectedText;
          }
          set
          {
  
              selectedText = value;
  
              SetProperty(ref selectedText, value);
          }
      }
  
      //////.........
  
      private void MyCommandExecuted(object obj)
      {
          TextProperty= string.Empty;
          MessageBox.Show("Command Executed");
      }
  </code></pre>
  
  <p>But it does not clear the textbox. What am I missing ?</p>