title: How works IViewFor Bind extension method?
body: <p>Simple question, but I dons see solution. Or may be dont understand how Bind method works.
  The goal is two way binding between ViewModel and DataContext properties.</p>
  
  <pre><code>    public MainWindow()
      {
          InitializeComponent();
  
          this.Bind(this, v =&gt; v.DataContext, v =&gt; v.ViewModel);
      }
  
      public static readonly DependencyProperty ViewModelProperty = DependencyProperty.Register(
          "ViewModel", typeof (string), typeof (MainWindow));
  
      public string ViewModel
      {
          get { return (string) GetValue(ViewModelProperty); }
          set { SetValue(ViewModelProperty, value); }
      }
  </code></pre>
  
  <p>when I set ViewModel property, I get InvalidCastException "System.String" to "WpfApplication1.MainWindow".</p>
  
  <p>But xaml binding works perfectly.</p>
  
  <pre><code>&lt;MainWindow 
     DataContext="{Binding RelativeSource={RelativeSource Self}, Path=ViewModel, Mode=TwoWay}" ...
  </code></pre>
  
  <p>full xaml.cs/xaml code is here <a href="http://pastebin.com/iCKeNS7R" rel="nofollow">http://pastebin.com/iCKeNS7R</a></p>
  
  <p>Where I wrong ?</p>
  
  <p><strong>update:</strong>
  this code:</p>
  
  <p><code>this.WhenAnyValue(v =&gt; v.ViewModel).BindTo(this, v =&gt; v.DataContext);
  this.WhenAnyValue(v =&gt; v.DataContext).BindTo(this, v =&gt; v.ViewModel);</code></p>
  
  <p>also works as expected </p>
  
  <p><strong>update 2</strong>
  Question: Does this.Bind(viewModelParam, ...)  ignore viewModelParam argument ??</p>
  
  <p>example^ <a href="http://pastebin.com/e2aPaGNc" rel="nofollow">http://pastebin.com/e2aPaGNc</a></p>
  
  <p>I bind to _otherViewModel, but when type text into textBox, ViewModel.StrProp changed, not _otherViewModel.</p>
  
  <p>Does anybody know, how this.Bind work ??</p>