title: How to create a bindable property in WPF?
body: <p>i have a user control. I want to create a bindable property in my user control. I create a DependencyProperty as follows:</p>
  
  <pre><code>public static readonly DependencyProperty DateProperty =
      DependencyProperty.Register("Date", typeof(DateTime), typeof(DaiesContainer), 
          new UIPropertyMetadata(DateTime.Now));
  
      public DateTime Date
      {
          get { return (DateTime)GetValue(DateProperty); }
          set
          {
              SetValue(DateProperty, value);
          }
      }
  </code></pre>
  
  <p>I then use it in my XAML: </p>
  
  <pre><code>&lt;ctrls:DaiesContainer  Date="{Binding Date, Mode=OneWay}"/&gt;
  </code></pre>
  
  <p>In my ViewModel, the get method of the Date property is called. But in my user control, Date property is not set to a value.</p>