title: Why is my DependencyProperty not accessible?
body: <p>I have a user control called AlarmSettings, the user control's resource dictionary contains an instance of my custom class "AlarmClock", the AlarmClock has a dependency property called AlarmName, why do I get the error Error <em>"The member "AlarmName" is not recognized or is not accessible."</em></p>
  
  <p>This is my user control:</p>
  
  <pre><code>&lt;UserControl x:Class="ChangeSet.AlarmSettings"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
  xmlns:alarm="clr-namespace:ChangeSet.Alarm;assembly=ChangeSet"
  mc:Ignorable="d"
  FontFamily="{StaticResource PhoneFontFamilyNormal}"
  FontSize="{StaticResource PhoneFontSizeNormal}"
  Foreground="{StaticResource PhoneForegroundBrush}"
  d:DesignHeight="480" d:DesignWidth="480" &gt;
  
  &lt;UserControl.Resources&gt;     
      &lt;alarm:AlarmClock x:Key="alarmClock" AlarmName="{Binding ElementName=AlarmSettings, Path=Name}"/&gt;
  &lt;/UserControl.Resources&gt;
  </code></pre>
  
  <p>This is my AlarmClock class:</p>
  
  <pre><code>public class AlarmClock: DependencyObject
  {
  
      public AlarmClock()
      {
          PopulateSettingsOptions();
      }
  
      public string AlarmName 
      {
          get { return GetValue(AlarmNameProperty).ToString(); }
          set { SetValue(AlarmNameProperty, value); }
      }
  
      public static readonly DependencyProperty AlarmNameProperty =
          DependencyProperty.Register("AlarmName", typeof(string), typeof(AlarmClock), new PropertyMetadata("DefaultAlarm"));
  </code></pre>
  
  <p>Note: I'm trying to bind the AlarmName to the Name property of the AlarmSettings user control but even if I remove the binding and try to set the AlarmName dependency property to a string I will still get the same error.</p>