title: Customized design-time attribute for WPF
body: <p>I've created a custom control, and would like to create an attribute (available in Blend's design-time) which would offer a dropdown or combobox.  The designer would then select one of the available options.  Very much like the "Cursor" combo in the "Common Properties" tab, except that I want full control over what items go in the combo.  The choices can vary, so I can't use a hard-coded "enum".</p>
  
  <p>I know it's possible to declare design attributes like this:</p>
  
  <pre><code>protected string mString;
  [Category("Common Properties")]
  [DisplayName("My Friendly Name")]
  public string MyFriendlyName
  {
     get { return mString; }
     set { mString= value; }
  }
  </code></pre>
  
  <p>In the case above, "My Friendly Name" is just a string.  The user can enter whatever he wants.</p>
  
  <pre><code>protected Uri mPathname;
  [Category("Common Properties")]
  [DisplayName("Resource pathname")]
  public Uri MyResPathname
  {
     get { return mPathname; }
     set { mPathname = value; }
  }
  </code></pre>
  
  <p>In the case above, "Resource pathname" has a combo box, but the list of items are handled by Blend.  </p>
  
  <p>If I use an enum, the result is a combo with my items in it, but then I can't change the item-list.</p>
  
  <pre><code>public enum MyChoices
  {
     Aaa,
     Bbb
  }
  
  public class MyButton : Button
  {
  
    (...)
  
    [Category("Common Properties")]
    public MyChoices MyChoice
    {
       get { return (MyChoices)GetValue(MyChoiceProperty); }
       set { SetValue(MyChoiceProperty, value); }
    }
  
    public static readonly DependencyProperty MyChoiceProperty =
          DependencyProperty.Register("MyChoice", 
                                      typeof(MyChoices), 
                                      typeof(MyButton ), 
                                      new UIPropertyMetadata(
                                            (MyChoices)MyChoices.Aaa,
                                            OnMyChoiceChangedCallback));
  
  }
  </code></pre>
  
  <p>In the example above, the choices are hard-coded in the enum... </p>
  
  <p>Can anyone help ?  I'm sure it's easy, I'm very close but now I'm going in circles.</p>