The registry key that contains the control registrations is at [ver]_Config\MainWindowFrameControls
.
Searching VS's DLLs (using Telerik's JustDecompile, which has mostly functional full-text search) for "MainWindowFrameControls" turns up the FrameControlManager
(in the Microsoft.VisualStudio.Shell.UI.Internal assembly and the Microsoft.VisualStudio.PlatformUI
namespace). That iterates the registry keys, creating a FrameControl
for each populated by calling its Read
method. The Read
method populates a few properties from the registry key, including its _factoryBundle
field. This contains the GUID of the view factory, view ID, and data source IDs as well (read from the registry key) that will be used to create the control.
The FrameControl
's FrameworkElement
property (which is almost certainly the part that actually gets displayed on the frame) lazily calls UIFactoryHelper.CreateElementAndDataSource()
, passing it the _factoryBundle
. This eventually calls WindowHelper.CreateUIElement
, which hands it off in turn to the IVsUiFactory
. Finally, we've reached a (lightly) documented part of VS -- this is part of the public interface.
It turns out that the view GUID of the frame control refers to one of the "UI Providers" registered by a package. (These can also be seen in the registry, under the _Config\UIProviders
key.)
So in short, you'll need to implement the IVsUiFactory
interface and register it with the IVsRegisterUIFactories
service, then expose (with, say, a .pkgdef or more cleanly with a C# custom attribute that does the registry manipulation for you) the corresponding values under a registry key for your control in MainWindowFrameControls
. This will let you create a custom WPF framework element that gets placed in the main window frame.
I didn't look into databinding, but apparently that's possible too -- just trace the FrameControl
code until you find out how it works (using a good decompiler -- I like a combination of JustDecompile for its full-text search, and dotPeek for its interface).
P.S. Hey, another isolated shell developer! Hi & good luck :-)