How can I get IntelliSense to automatically populate an enumeration on a user / user control in XAML?

Possible duplicate:
WPF: how to display enum property values ​​in xaml vs2008 intellisense editor?

In XAML, if I define the Orientation property for a StackPanel, IntelliSense displays an Orientation enumeration. If I define my own enumeration-based DependencyProperty control, is there a way to force IntelliSense to call an enumeration?

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 would prefer code example.

To get this done:

  • Add the XmlnsDefinition attribute to AssemblyInfo.cs

    [build: 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 a control, and IntelliSense will display the enumeration values

+4
source share
1 answer

try something like this or use ReSharper

0
source

All Articles