Bruno Antunes
Bruno Antunes

Reputation: 2262

C# custom property editor

I have the following custom property in my code:

public Dictionary<int, string> ServiceIdList
    {
        get
        {
            return ((Dictionary<int, string>)(GetValue(LoadSubscriptionList.ServiceIdListProperty)));
        }
        set
        {
            SetValue(LoadSubscriptionList.ServiceIdListProperty, value);
        }
    }

But the property editor for this (String Collection Editor) comes up disabled. Do I have to implement a custom UITypeEditor or can the getters and setters be improved as to provide 'hints' to the editor as to what types can be in an entry?

Thanks for any help!

Upvotes: 2

Views: 1965

Answers (1)

rakuo15
rakuo15

Reputation: 889

I found this thread that may be of help to you: http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/f2ecec70-4e44-43bb-8a09-feb8a55b365c

It appears that generic Dictionary objects do not have an editor that works with them. You'd have to derive from the CollectionEditor and override a few functions, such as CreateNewItemTypes.

Upvotes: 2

Related Questions