title: Binding visibility property
body: <p>I have gone through several questions regarding this but couldn't get proper answer. I dont know where am wrong with the following code. I am binding visibility property of TextBlock but its not working. Here is my xaml code and am changing visibility property of textblock in button click.</p>
  
  <pre><code>&lt;TextBlock Visibility="{Binding IsVisible}" Text="Visibility Sample" Margin="12,40" HorizontalAlignment="Center" Name="visibilityTextblock"/&gt;
  &lt;Button Content="visibility" Tap="Button_Tap_1"/&gt;
  </code></pre>
  
  <p>Here is my <code>Button_Tap_1</code> function.</p>
  
  <pre><code>private void Button_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
      {
              IsVisible = Visibility.Visible;            
      }
  </code></pre>
  
  <p>Here is my <code>IsVisible</code> Property.</p>
  
  <pre><code>private Visibility _isVisible;
  public Visibility IsVisible
      {
          get
          {
              return _isVisible;
          }
          set
          {
              _isVisible = value;
              NotifyPropertyChanged("IsVisible");                
          }
      }
  </code></pre>
  
  <p>And finally here is my <code>NotifyPropertyChanged</code> Method.</p>
  
  <pre><code>#region NotifyPropertyChanged
  
      public event PropertyChangedEventHandler PropertyChanged;
  
      private void NotifyPropertyChanged(string p)
      {
          if (PropertyChanged == null)
              return;
          PropertyChanged(this, new PropertyChangedEventArgs(p));
      }
  
  #endregion
  </code></pre>
  
  <p>By default, am initializing Textblock visibility to collapsed by changing its property like,</p>
  
  <pre><code>IsVisible = Visibility.Collapsed; ( in the constructor)
  </code></pre>
  
  <p>I also derieved from <code>INotifyPropertyChanged</code> Interface and am implementing all these in a same class file. Can anyone help me where am wrong?</p>