title: How To Bind a Property to Textbox using MVVM and MVVM toolkit?
body: <p>I am new to MVVM. to learn I created a sample application to show a message in a text box while clicking on button. In my code the button command is working properly but the property is not binding to the Textbox. How to bind Property to Textbox using MVVM? </p>
  
  <p>My code is similar like given below.</p>
  
  <p>View</p>
  
  <pre><code>&lt;TextBox Name="MessageTextBox" Text="{Binding TestMessage}"/&gt;
  &lt;Button Content="Show" Name="button1" Command="{Binding ShowCommand}"&gt;
   &lt;!-- Command Handler --&gt;
  &lt;/Button&gt;
  </code></pre>
  
  <p>View Model</p>
  
  <pre><code>MyMessage myMessage; 
  public MainViewModel()
  {
  myMessage=new MyMessage();
  }
  
  //inside the ShowCommand Handler
  
  TestMessage="Hello World";
  
  // A Property to set TextBox Value. 
  </code></pre>
  
  <p>Model</p>
  
  <pre><code>public class MyMessage: INotifyPropertyChanged        
  {     
      private string testMessage;
      public string TestMessage
      {
          get { return testMessage; }
          set
          { 
              testMessage= value;
              OnPropertyChanged("TestName");
          }
      }
      public event PropertyChangedEventHandler PropertyChanged;
      private void OnPropertyChanged(string propertyName)
      {
          if (PropertyChanged != null)
          {
              PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
          }
      }
  
  }
  </code></pre>