Ошибка свойства зависимости

Я изучаю свойства зависимости. Я прочитал много постов & amp; книги но все же мне не понятно.

Показанная ниже программа - это то, что я написал для изучения. Некоторые ошибки в этом, пожалуйста, помогите в решении. У меня есть вопросы.

The main use of custom Dependency property element is for the notification of change? I found an 'IsDefaultProperty' code for Button in a WPF text book. It means 'IsDefault' property is a dependency property? Why they shown that code? It means, internally, in Button class, its defined like that? (They showed internal code?) or they showed how to define as custom?

Вот мой код:

<code>namespace DependencyProperties
{
    public class Contact
    {
        private int id=100;
        private string name="shri";
        public static readonly DependencyProperty IsPresentProperty;

        public int ID
        {
            get { return id; }
        }
        public string NAME
        {
            get { return name; }
        }

        static Contact()
        {
            IsPresentProperty = DependencyProperty.Register("IsPresent", typeof(bool),typeof(Contact),new FrameworkPropertyMetadata(false,new PropertyChangedCallback(OnIsPresentChanged)));
        }

        public bool Present
        {
            get { return (bool)GetValue(Contact.IsPresentProperty); }
            set { SetValue(Contact.IsPresentProperty, value); }
        }

        private static void OnIsPresentChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {  

        }
    }
}
</code>

И я вижу ошибку:

<code>> Error: GetValue and SetValue does not exist in the current context
</code>

Ответы на вопрос(2)

Ваш ответ на вопрос