title: Dependency property not getting registered in one specific control in WPF
body: <p>I have two different controls, both of them have a property called Value. I am using pretty much the same code in both cases. And yet, in one case, I get binding error saying "Binding can be done only for dependency property in dependency object.</p>
  
  <p>Below is the code to implement the dependency property</p>
  
  <pre><code>Public Class Calender
  Implements INotifyPropertyChanged
  
  Public Shared ValueProperty As DependencyProperty = DependencyProperty.Register("Value", GetType(String), GetType(Calendar))
  Public Property Value() As String
      Get
          If Not TryCast(Me.GetValue(ValueProperty), String) Is Nothing Then
              Return TryCast(Me.GetValue(ValueProperty), String)
          Else
              Return String.Empty
          End If
      End Get
      Set(value As String)
          Me.SetValue(ValueProperty, value)
      End Set
  End Property
  Public Event PropertyChanged As PropertyChangedEventHandler _
          Implements INotifyPropertyChanged.PropertyChanged
  </code></pre>
  
  <p>This is the exact same code I am using in another control. It works fine in that control, but in this case, it does not work. Also, when I use this Value property as</p>
  
  <pre><code>Value="{Binding MeasuringTapeCalibrationDue,Mode=TwoWay}"
  </code></pre>
  
  <p>it displays a squiggly line in XAML editor, saying "Value property was already registered by Calendar". I have the above code registering the value property just once. </p>