Making custom property editor for Visual Studio 2019

103 views Asked by At

I want to make a custom property editor for some of my own types in Visual Studio (and/or Blend) in a .NET Framework (4.6.1) project. This process is relatively well-documented, but the documentation is all nearly 10 years old and written for VS2008 (I'm currently on VS2017 and VS2019). Some of the instructions seem outdated and some libraries don't exist anymore, which makes me think something has changed.

I've ran through all instructions here: Custom editor

I have ended up with all DLLs with the right names and in the right place, but VS seems to completely ignore them.

Output

I have narrowed it down to the idea that it seems that the Metadata of my library is probably never loaded. From all online sources, it seems that the following code ought to register my property editor, as long as its file is names "xxx.Design.dll" and implements IRegisterMetedata but VS doesn't seem to ever call it.

    public class Metadata : IRegisterMetadata
    {

        // Called by Cider to register any design-time metadata
        public void Register()
        {
            AttributeTableBuilder builder = new AttributeTableBuilder();
            builder.AddCustomAttributes
                (typeof(CustomControl1),
                Control.BackgroundProperty,
                PropertyValueEditor.CreateEditorAttribute(
                    typeof(BrushInlineEditor)));
            MetadataStore.AddAttributeTable(builder.CreateTable());
        }
    }

Has something changed, in 10 years of Visual Studio updates? Could it have something to do with security settings? Is VS2019 using different interfaces that ought to load the custom editor? I can't figure out what's going on here.

0

There are 0 answers