title: OneWay DependencyProperty to ViewModel property binding
body: <p>I have a <code>UserControl</code> with a dependency property, I need this property to be bound to a CLR property in the parent ViewModel. I've cooked up a small application to demonstrate the problem.</p>
  
  <p><strong>UserControl</strong></p>
  
  <pre><code>&lt;UserControl 
           ...
           x:Name="usr"&gt;
      &lt;Grid&gt;
          &lt;TextBox Text="{Binding SomeProperty, ElementName=usr}"/&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>And the code behind:</p>
  
  <pre><code>public partial class UserControl1 : UserControl
  {
      public string SomeProperty
      {
          get { return (string)GetValue(SomePropertyProperty); }
          set { SetValue(SomePropertyProperty, value); }
      }
  
      public static readonly DependencyProperty SomePropertyProperty =
          DependencyProperty.Register("SomeProperty", typeof(string), typeof(UserControl1), new PropertyMetadata(null));
  
      public UserControl1()
      {
          InitializeComponent();
      }
  }
  </code></pre>
  
  <p><strong>Parent View</strong></p>
  
  <pre><code>&lt;Window ... &gt;
      &lt;Window.DataContext&gt;
          &lt;ViewModels:MainWindowViewModel/&gt;
      &lt;/Window.DataContext&gt;
  
      &lt;Grid&gt;
          &lt;Controls:UserControl1 SomeProperty="{Binding SomeText, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p><strong>Parent ViewModel</strong></p>
  
  <pre><code>public class MainWindowViewModel : INotifyPropertyChanged
  {
      public event PropertyChangedEventHandler PropertyChanged;
  
      protected void OnPropertyChanged([CallerMemberName]string propertyName = null)
      {
          if (PropertyChanged != null)
              PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
      }
  
      private string _SomeText;
  
      public string SomeText
      {
          get { return _SomeText; }
          set 
          { 
              _SomeText = value;
              OnPropertyChanged();
          }
      }
  }
  </code></pre>
  
  <p>Essentially, what I need is whatever has been entered in the UserControl's <code>TextBox</code> (The <code>SomeProperty</code> property) will need to update the ViewModel's <code>SomeText</code> property.</p>
  
  <p>I do not require two way binding.</p>
  
  <p><em>Apologies for the sea of code, but it's all there if anyone wants it.</em></p>