Basically I am creating a VS2013 extension with a dialog which should have the same layout and colors as the New Project/Add Item dialogs.
It is a dialog which presents templates for code generation on the left pane and a treeview of types in the current solution in the middle pane.
To my greatest joy, I have found the Microsoft.VisualStudio.PlatformUI.EnvironmentColors class, which contains a lot of the color keys for referencing themed colors in VS, but unfortunately it does not contain the colors for the "New Project Dialog" category, which can for example be seen and changed under "NewProjectDialog" in the theme color editor's advanced view. These theme settings are responsible for a consistent look across "New Project", "Add item", the Nuget Package Manager and a few other similar dialogs.
The VS Extensibility UX Guidelines actually mention that themed colors from VsColors should be used. VsColors exports a few properties for apparently non-categorized color values, but not for the NewProjectDialog category.
After tinkering around a little, I have found the colors programmatically via enumeration of Microsoft.VisualStudio.Shell.VsColors.GetCurrentThemedColorValues()
and theoretically I could set them from there in the code-behind:
var allColors = VsColors.GetCurrentThemedColorValues().Keys;
var newProjColors = allColors.Where(c => c.Category == new Guid("c36c426e-31c9-4048-84cf-31c111d65ec0")); // guid extracted from an exported theme
var newProjBgKey = newProjColors.SingleOrDefault(c => c.Name == "Background");
This seems to be totally backwards and furthermore it clutters up my otherwise empty code-behind.
How do I correctly reference the colors in the NewProjectDialog category from XAML?