我有以下UserControl
public partial class TestCtrl : UserControl
{
public enum Alignments
{
HORIZONTAL,
VERTICAL
}
public TestCtrl()
{
InitializeComponent();
}
public static DependencyProperty AlignmentProperty = DependencyProperty.Register(
"Alignment",
typeof(Alignments),
typeof(TestCtrl),
new PropertyMetadata(Alignments.HORIZONTAL));
public Alignments Alignment
{
get
{
return (Alignments)GetValue(AlignmentProperty);
}
set
{
SetValue(AlignmentProperty, value);
}
}
}
该属性有效,但在xaml中使用该属性时,auto-complete不会检测该属性的可能值。