in Development

Visual Studio 2010 Extensibility

If you open Visual Studio 2010 the first thing you probably will notice is that the Start Page has been completely redesigned. The Start Page is now created with WPF, yes you have read it correctly, and it is not the only thing that uses WPF, the code editor is also WPF based.

Original start page

As you can imagine the page can be customized (which by the way was already possible in Visual Studio 2003), to do it you only need to modify the template found in the directory “%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\StartPages\<culture>”, place your modified version in the folder “%UserProfile%\Documents\Visual Studio 10\StartPages” and that’s all, your customized StartPage will be loaded immediately without needing restart Visual Studio.

Mad about NET Section

The screenshot above shows an easy customization that I’ve done. I’ve just added a new TrayItem on the left side and took profit of the dll Microsoft.VisualStudio.Shell.UI to run some Visual Studio commands to open an IE window, view Visual Studio as full screen and open the Team Explorer window. Below you can see the necessary XAML to do it.

<!-- Customized tray-->
<!-- Mad About .NET group -->
<vs:trayitem header="Mad about .NET" x:uid="Custom_Header">
    <vs:traygroup>
        <vs:traygroupitem content="Mad about .NET Blog" 
            imagesource="pack://application:,,,/Microsoft.VisualStudio.Shell.UI;
                        Component/Packages/StartPage/Images/12_settings.png"
            command="{x:Static vs:VSCommands.Browse}"
            commandparameter="{StaticResource Links.MadAboutNET}"
            x:uid="MadaboutNET_Item"
        />
        <vs:traygroupitem content="Go Full Screen"
            imagesource="pack://application:,,,/Microsoft.VisualStudio.Shell.UI;
                        Component/Packages/StartPage/Images/12_settings.png"
            command="{x:Static vs:VSCommands.ExecuteCommand}"
            commandparameter="View.FullScreen"
            x:uid="TeamExplorer_Item"
        />
        <vs:traygroupitem content="Open Team Explorer"
            imagesource="pack://application:,,,/Microsoft.VisualStudio.Shell.UI;
                        Component/Packages/StartPage/Images/12_settings.png"
            command="{x:Static vs:VSCommands.ExecuteCommand}"
            commandparameter="View.TeamExplorer"
            x:uid="TeamExplorer_Item"
        />
    </vs:traygroup>
</vs:trayitem>

Regardless the utility or futility of customizing the StartPage, we need to look further. We must look the new extensibility options that Visual Studio 2010 will bring, incorporating WPF opens a new world of options to extend our favorite development tool. But this is just a small piece of the cake, if you want to know more you should check the Managed Extensibility Framework and don’t forget to visit the blog of the VSX Team.