title: WPF- Bind object property to control in xaml
body: <p>I have clearly stated my issue below.  
  
  <p>Thank you in advance
  --></p>
  
  <p>I have a public class:</p>
  
  <pre><code>public class class1
  {
   int iVal;
   public int IVal
   {
    get { return iVal; }
    set { iVal=value;  }
   }
  }
  </code></pre>
  
  <p>I am going to create an object of  type <code>class1</code> inside my mainWindow.cs.</p>
  
  <pre><code>class1 ob = new class1();
  </code></pre>
  
  <p>In the mainWindow.xaml file I have a <code>TextBlock</code>.</p>
  
  <p>My question is how to bind the <code>ob.IVal</code> value to the <code>TextBlock</code> using XAML binding.</p>
  
  <pre><code>&lt;TextBlock Text="{Binding IVal, Mode=OneWay}"/&gt;   
  // this binding is not working for me.
  </code></pre>