title: WPF's DataContext questions
body: <p>I asked about how does it work with INotifyPropertyChanged interface( <a href="https://stackoverflow.com/questions/6789236/how-does-wpf-inotifypropertychanged-work">How does WPF INotifyPropertyChanged work?</a> ), and it requires me to connect XAML's DataContext to the INotifyPropertyChanged inherit instances as follows.</p>
  
  <pre><code>MainViewModel model = new MainViewModel();        
  this.DataContext = model;
  </code></pre>
  
  <p>And I also found a recommendation to have a comment for DataContext that each XMAL uses( <a href="http://joshsmithonwpf.wordpress.com/2009/10/24/xaml-tip-datacontext-comment/" rel="nofollow noreferrer">http://joshsmithonwpf.wordpress.com/2009/10/24/xaml-tip-datacontext-comment/</a> ).</p>
  
  <p>When I have multiple XAML files, and when I want to link the DataContext to different ViewModel, I guess I need to make the each XAML.CS file to contain this code (model varies for each xaml.cs) :<code>this.DataContext = model;</code>. </p>
  
  <ul>
  <li>Is this correct? </li>
  <li>How can I do the same thing in XAML file? </li>
  <li>What's the magic behind this DataContext thing? I mean, how does DataContext work?</li>
  </ul>