In XAML if I am defining the Orientation property for a StackPanel, IntelliSense brings up the Orientation enum. If I'm defining my own control with a DependencyProperty based on an enum, is there a way to get IntelliSense to bring up the enum?
Enum:
public enum MyEnum { Foo, Bar }
DependencyProperty in control:
public static readonly DependencyProperty MyEnumValueProperty =
DependencyProperty.Register(
"MyEnumValue",
typeof(MyEnum),
typeof(MyControl),
new UIPropertyMetadata());
public MyEnum MyEnumValue
{
get { return (MyEnum)GetValue(MyEnumValueProperty); }
set { SetValue(MyEnumValueProperty, value); }
}
EDIT:
Giving the answer to "Daniel Pratt", because he pointed me in the right direction. I'd have preferred a code example.
To get this to work:
Add the XmlnsDefinition attribute to AssemblyInfo.cs
[assembly: XmlnsDefinition("http://schemas.your-company.com/wpf/", "YourNamespace")]
In the XAML source where the control will be defined add an xmlns entry for it
xmlns:control="http://schemas.your-company.com/wpf/"
Then presto, you can add the control and IntelliSense will bring up the enum values