日期:2014-05-20 浏览次数:20705 次
public class MyProperty:DependencyObject { private string _name = ""; public string Name { get { return (string)GetValue(NameProperty); } set { SetValue(NameProperty, value); } } public static readonly DependencyProperty NameProperty = DependencyProperty.Register("Name", typeof(string), typeof(MyProperty)); } public void ttt() { //之后就可以调用这个属性了 MyProperty property = new MyProperty(); property.Name = "TTTTT_TTTTTT"; }