title: Binding in MvvmCross from a view's codebehind
body: <p>For a XAML view, I have it hooking onto <code>this.ViewModel.PropertyChanged</code> like so:</p>
  
  <pre><code>ViewModel.PropertyChanged += (s, e) =&gt;
  {
      if (e.PropertyName == "CurrentImage")
          DoStuff();
  };
  </code></pre>
  
  <p>This is because XAML is not flexible enough for me to achieve what I'd like directly without codebehind, and also because it's code that is purely related to WinRT/XAML and not the core portable project.</p>
  
  <p>However during the view's constructor, the <code>ViewModel</code> property is null, thus it was worked around like so:</p>
  
  <pre><code>this.Loaded += (s2, e2) =&gt;
  ViewModel.PropertyChanged += (s, e) =&gt;
  {
      if (e.PropertyName == "CurrentImage")
          DoStuff();
  };
  </code></pre>
  
  <p>I figure this (in addition to using a string to refer to a property) is probably not very clean, and there probably should be a better way to achieve what I'd like. Is there a more ideal approach?</p>