Custom XAML Designer in Visual Studio Custom Project Types

I created a custom XAML constructor as http://code.msdn.microsoft.com/windowsdesktop/Designer-View-Over-XML-20a81f17 I have a question: how to make a custom constructor work only on certain types of projects (for example, a custom project type) and all other default project designers.

The file VsTemplateDesignerPackage.cs has:

// Microsoft Visual Basic Project [EditorFactoryNotifyForProject("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", EditorFactory.Extension, GuidList.guidXmlChooserEditorFactory)] // Microsoft Visual C# Project [EditorFactoryNotifyForProject("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", EditorFactory.Extension, GuidList.guidXmlChooserEditorFactory)] 

I add:

 //CustomProjectType [EditorFactoryNotifyForProject("{GUID CustomProjectType}", EditorFactory.Extension, GuidList.guidXmlChooserEditorFactory)] 

But that will not work. This leads to the fact that the custom designer for this extension is used in all types of projects.

How to create a custom constructor for opening * .XAML files only in custom projects?

+7
c # visual-studio-2010 wpf visual-studio-2012 xaml
source share
1 answer

I think there is no standard way to do this in VSSDK. The designer is mainly aimed at a specific file extension and will be called for this file extension in any type of project.

I would try to see if there is a way to redirect or reject the request to create / create an instance of this editor after checking the current type of the loaded project or, alternatively, find the next built-in editor for your file type and create an instance and return it.

Unfortunately, I cannot provide technical data or code, since it has been years since I last touched any VSSDK code.

0
source share

All Articles