title: Set property on ViewModel from View
body: <p>What do I need to add to set a public property on my ViewModel instance from my View? I'd like to set some properties on the ViewModel resource rather than bind it from some element in my view.</p>
  
  <p><strong>View XAML:</strong></p>
  
  <pre><code>&lt;UserControl.Resources&gt;
     &lt;vm:MainViewModel x:Key="mainViewModel" MyProperty="30" /&gt;
  &lt;/UserControl.Resources&gt;
  &lt;UserControl.DataContext&gt;
     &lt;Binding Source={StaticResource mainViewModel}" /&gt;
  &lt;/UserControl.DataContext&gt;
  </code></pre>
  
  <p><strong>MainViewModel.cs (implements INotifyPropertyChanged)</strong></p>
  
  <pre><code>private int _myProperty;
  public int MyProperty{
      get { return _myProperty; }
      set 
      { 
          _myProperty = value;
          OnPropertyChanged("MyProperty");
      }
  }
  </code></pre>
  
  <p>The setter on MyProperty is never called. There must be some fundamental MVVM thing i'm doing wrong.</p>