写了一个UserControl,定义了一个public的属性,却在xaml文件中敲不出来这个属性,属性的定义如下:
public class MyUserControl:UserControl
{
public string MyProperty{ set;}
}
后来发现是因为这个属性没有getter的原因。修改成如下,就可以在xaml中敲出来了。
public class MyUserControl:UserControl
{
public string MyProperty{get;set;}
}