title: ReactiveUI binding with dependencyproperty and pass to viewmodel
body: <p>I started using ReactiveUI (with WPF) for first time and have little problem which I couldn't google out or find on docs. How do you bind properties from Control's DependencyProperty?</p>
  
  <p>I'm creating a user control</p>
  
  <pre><code>public partial class MotorControlView: ReactiveUserControl&lt;MotorControlViewModel&gt;
  </code></pre>
  
  <p>and inside the class I have dependency property MotorAxis </p>
  
  <pre><code>public static readonly DependencyProperty MotorAxisProperty = DependencyProperty.Register(
      "MotorAxis", typeof(MotorAxis), typeof(MotorControlView));
  
  public MotorAxis MotorAxis
  {
      get =&gt; (MotorAxis) GetValue(MotorAxisProperty);
      set =&gt; SetValue(MotorAxisProperty, value);
  }
  </code></pre>
  
  <p>Inside the view there is TextBlock which should show <code>MotorAxis</code> (it's an enum) string value (NoVal/X/Y/Z). 
  The property is set in <code>MainWindow.XAML</code>  ( <code>&lt;uc:MotorControlView MotorAxis="Y" /&gt;</code> )</p>
  
  <p><strong>The problem is:</strong></p>
  
  <ul>
  <li>how do I bind label's text to MotorAxis control's property using ReactiveUI? </li>
  <li>how do I pass the value to ViewModel</li>
  </ul>
  
  <p>In the constructor its value is always default (NoVal), so I think I can't pass it to viewmodel constuctor...   </p>
  
  <p>The ViewModel will be responsible for accessing X/Y/Z motor based on this parameter</p>
  
  <hr>
  
  <p>The only solution I got found out is doing so:</p>
  
  <pre><code>//In View:
  public MotorControlView()
  {
      InitializeComponent();
      ViewModel = new MotorControlViewModel();
      this.WhenActivated(dr =&gt;
      {
          ViewModel.MotorAxis = this.MotorAxis;
      });
      this.Bind(ViewModel, vm =&gt; vm.MotorAxis, v =&gt; v.MotorAxisBlock.Text);
  }
  </code></pre>
  
  <p>//In VM:
  property with 
  <code>this.RaiseAndSetIfChanged(ref this.motorAxis, value)</code></p>
  
  <p>Is there a more elegant way to do this without manually setting value in WhenActivated? So I will have this value accessible in eg. VM's constructor? </p>