title: WPF bind usercontrol's property to parent's property
body: <p>I have created a usercontrol, which has 2 dependency properties. I want to bind those dependency properties to the mainViewModel's property, so that whenever something gets changed in the user-control the parent's property gets updated.</p>
  
  <p>I tried, binding it normally but it didn't work. How can I bind the user-control's DP to the parent's property.</p>
  
  <p>I tried this: 
  UC: </p>
  
  <pre><code>&lt;TextBox Name="TextBox" Text="{Binding ElementName=UCName, Path=DP1, Mode=TwoWay}"/&gt;
  </code></pre>
  
  <p>MainWindow:</p>
  
  <pre><code>&lt;UCName:UCName Width="330" CredentialName="{Binding Path=DP1, Mode=TwoWay}"&gt;&lt;/UCName:UCName&gt;
  </code></pre>
  
  <p>Thanks</p>