[Silverlight] DependencyPropertyの登録方法

7:41 PM on 2010年12月10日 ,

public class MyClass : DependencyObject
{
    public MyClass()
    {
    }

    public string Test
    {
        get
        {
            return (string)GetValue(TestProperty);
        }
        set
        {
            SetValue(TestProperty, value);
        }
    }

    public static readonly DependencyProperty TestProperty = DependencyProperty.Register("Test", typeof(string), typeof(MyClass), new PropertyMetadata(""));
}
(参考)
http://msdn.microsoft.com/ja-jp/library/system.windows.dependencyproperty.register%28VS.80%29.aspx