f59cecb137
* Updated new picture for ReadMe file. * Updated Example.BuildProgressBar.png, Updated ReadMe file with correct references. * Updated Example.CaretFishEye.png and Readme.md with current references * Updated Example.CodeSweep.png and Readme.md with current references * ReadMe.md updates and ComboBox.png update * fixed typo * Updated ReadMe.md references. * Updated Example.CommandTargetRGB.png * Updated references in Readme.md and Example.CompletionTooltipCustimzation.png. Upgraded to make roundtripable. * Fixed Typo in Readme.md * Removed typo. * Updated ReadMe.md and Example.DiffClassifier.png * Updated Reame.md and Example.EditorWithToolBox * Updated Readme.md and Example.SpelllingError.png * fixed typo * updated Example.HighlighWord.png and Readme.md * Updated ReadMe.md and Example.IntraTextAdornment.png * Updated Example.LightBulb.png and readme.md * Updated Example.MSDN.png and Readme.md * Updated Example.MenusAndCommands.png and ReadMe.md * Fixed Typo * Updated Example.Ook.png and Readme.md * updated ReadMe.md * Updated Example.OptionsPage1.png and Readme.md * Updated Example.Package.png and readme.md * Updated Example.Reference.Service.png and Readme.md * Fixed Typo * updated Example.RTDEvent.png and readme.md * Fixed typo. * Fixed Typo * Fixed typo in png name * updated Example.SingleFileGenerator.png and Readme.md * updated Example.SingleFileGenerator.png * Updated Example.SccProvider.png and readme.md * Updated Example.SourceControlStatus.png and readme.md * Fixed file locations * Fixed typo * Updated Readme.md and Example.ToDoClassification.png * Fixed Typo * Updated Readme.md * Updated png and readme.md * Fixed white space * Corrected file location * Updated Example.ToolWindow.png and Readme.md * Fixed Typo * Updated Readme.md * Fixed white space |
||
---|---|---|
.. | ||
WPFDesigner_XML | ||
Readme.md | ||
WPFDesigner_XML.sln |
Readme.md
Designer View Over XML Editor Sample
Provides a WPF Editor when editing XML files that have the '.vstemplate' file extension in Visual Studio.
- Technologies: Visual Studio 2017 SDK
- Topics: Visual Studio Shell
Description
This sample demonstrates how to create an extension with a WPF-based Visual Designer for editing XML files with a specific schema (XSD) in coordination with the Visual Studio XML Editor. In this sample we implement a basic view for .vstemplate files.
Requirements
Get all samples
Clone the repo (How to):
git clone https://github.com/Microsoft/VSSDK-Extensibility-Samples.git
Run the sample
- To run the sample, hitF5 or choose theDebug > Start Debugging menu command. A new experimental instance of Visual Studio will launch.
- Once loaded, press theOpen File button. (Ctrl + O)
- Browse to the TestTemplates sub-directory within the solution and open a file with the '.vstemplate' file extension.
- A new tab opens with the contents of the file laid out in the fields of a WPF form
- Navigate to theView menu and click onCode.
- An additional tab opens with the contents of the file formatted by the XmlEditor
Project Files
- AssemblyInfo.cs
This file contains assembly custom attributes.
- VsTemplateDesignerPackage.cs
Registers the designer, via ProvideXmlEditorChooserDesignerView, as the preferred editor view for files with the .vstemplate extension and indicated schema .
- EditorFactory.cs
Determines if the document to be edited already exists (was already opened in the Xml Editor view), rather than assuming it must be created; creates the designer’s EditorPane as the new Editor.
- EditorPane.cs
Creates the sited designer control and associated XmlModel for the file and text buffer.
- IViewModel.cs
Expresses the interface needed to bind the designer controls to the XmlSchema.
- ViewModel.cs
Implements IViewModel and manages the events needed to synchronize data between the fields in the designer and the underlying XML document, which may also be seen in the XML Editor.
- VsDesignerControl.xaml[.cs]
Implements the WPF controls expressing the designer interface and binds them to the ViewModel.
- VsTemplateSchema.cs
XML schema file generated via xsd.exe vstemplate.xsd /classes /e /n:MyNameSpace.
Related topics