Code sample: custom project PropertyPage (MPF, VSX)

by Dmitry [dimaka] Pavlov 2. July 2010 18:46

I’m getting a lot of emails from Visual Studio Extensibility developers to help them with implementing custom property pages (like tabs you see on Project Properties) for custom projects systems in MPF packages they develop.

A few year ago I’ve posted the good sample of that on MSDN Forums (Visual Studio Extensibility). So if you are looking for code sample how to create add custom property page to you custom project – have a look here:

MSDN - Visual Studio Extensibility Forum: Sample code for custom property pages (MPF, C#)

In short – what you need to do:

1. The real class should be inherited from that base. Like RealCustomPropertyPage : CustomPropertyPage

2. And then registered in your custom project node class:
        protected override Guid[] GetConfigurationIndependentPropertyPages()
        {
            return new Guid[]
                {
                    typeof(RealCustomPropertyPage).GUID,
                };
        }

or
        protected override Guid[] GetConfigurationDependentPropertyPages()
        {
            return new Guid[]
                {
                    typeof(RealCustomPropertyPage).GUID,
                };
        }

3. As well as in registration attributes for your custom package class:

    [ProvideObject(typeof(RealCustomPropertyPage), RegisterUsing = RegistrationMethod.CodeBase)]

In more details:

Visit link: “Sample code for custom property pages (MPF, C#)”. You will find there the C# code of RealCustomPropertyPage class mentioned above.

Hope that saves your time and helps,

Tags:

Coding | Links | Tips | Visual Studio | VSX | MPF

Comments

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar