title: How to use DependencyProperty in user Control
body: <p>I want to create a user control that can recieve a parameter via xaml.</p>
  
  <p>i search and tried a few things, bu none of them seems to work for me.
  i'm attaching the important code.
  My user control Code (only the dependency property):</p>
  
  <pre><code> public static readonly DependencyProperty DatabaseNameProperty = DependencyProperty.Register(
          "DatabaseName", typeof(string), typeof(TablesForm), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsArrange));
      public string DatabaseName
      {
          get { return (string)GetValue(DatabaseNameProperty); }
          set
          {
              SetValue(DatabaseNameProperty, value);
              NotifyPropertyChanged("DatabaseName");
          }
      }
  </code></pre>
  
  <p>The call From Main Window:</p>
  
  <pre><code>&lt;StackPanel&gt;
       &lt;local:TablesForm DatabaseName="Testing"/&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p>When i put in the user control construcor the string directly into the dependencyProperty it works.
  It would be great if can someone explain the logic behind (and help me with my problem)</p>
  
  <p>Thank for the help.</p>