title: MVVM + UserControl + Dependency Property
body: <p>Alright, this is somewhat related to this question: <a href="https://stackoverflow.com/questions/15162274/wpf-printing-multiple-pages-from-a-single-view-model">WPF Printing multiple pages from a single View Model</a></p>
  
  <p>I tried to follow the advice given there but now I am stuck.</p>
  
  <p>My application uses a MainView.xaml and the appropriate MainViewViewModel.cs, I am using MVVM Light in the background.</p>
  
  <p>Now - according to the post - it seems I have to do the following:</p>
  
  <ul>
  <li>Create a user control</li>
  <li>Expose some properties from the user control</li>
  <li>Make sure the view model shows these properties</li>
  </ul>
  
  <p>The idea is clear but I am stuck when trying to notify each other.</p>
  
  <p>My user control (UcTest.xaml) exposes a Dependency Property:</p>
  
  <pre><code>public string SpecialText
  {
      get { return (string)GetValue(SpecialTextProperty); }
      set
      {
          SetValue(SpecialTextProperty, value);
  
      }
  }
  
  // Using a DependencyProperty as the backing store for SpecialText.  This enables animation, styling, binding, etc...
  public static readonly DependencyProperty SpecialTextProperty =
      DependencyProperty.Register("SpecialText", typeof(string), typeof(UcTest), new PropertyMetadata(new PropertyChangedCallback(SpecialTextChangedPropertyCallback)));
  
  private static void SpecialTextChangedPropertyCallback(DependencyObject sender, DependencyPropertyChangedEventArgs e)
  {
      // Do something
      Debug.WriteLine("Ffgdgf");
  }
  </code></pre>
  
  <p>Alright, so I do now have a user control which has some dependency properties. Yet, these properties are completely separated from my ViewModel properties (those are the ones which shall be displayed).</p>
  
  <p>So basically I have two possibilities:</p>
  
  <ul>
  <li>How can I now tell my ViewModel for the UserControl that some properties have changed?</li>
  <li>Is there a possibility to forget about the dependency properties and access the view model directly?</li>
  </ul>
  
  <p>Additional info #1:
  I have uploaded a (simple) example of what I am trying to do here: <a href="http://www.box.com/s/2eqdm4x8ujryl9k4b1mw" rel="nofollow noreferrer">Example Project</a>. I would like to change the value of the label in UserControl1 (via the binding property in the ViewModel for UserControl1) from my MainViewViewModel.</p>