title: WPF Bind to class member in code behind
body: <p>Pretty simple question, but can't seem to find a complete answer on here...</p>
  
  <p>I need to databind in xaml to a property of a class member in codebehind.</p>
  
  <pre><code>&lt;Window x:Class="Main"&gt;
      &lt;customcontrol Name="View" IsChecked="{Binding ElementName=RecordProp, Path=IsViewChecked}" /&gt;
  ...
  </code></pre>
  
  <p>Where the code behind looks like:</p>
  
  <pre><code>class Main 
  {    
      ...
      private Record _record;
      public Record RecordProp
      {
        get { return _record; }
      }
      ...
  }
  
  
  class Record
  {
    public bool IsViewChecked
    {
      get; set;
    }
  }
  </code></pre>
  
  <p>What I've got now doesn't work, what am I doing wrong?</p>