Alessandro Del Sole's Blog

/* A programming space about Microsoft® .NET® */
posts - 159, comments - 0, trackbacks - 0

My Links


Your host

This is me! This space is about Microsoft® .NET® and Microsoft® Visual Basic development. Enjoy! :-)

These postings are provided 'AS IS' for entertainment purposes only with absolutely no warranty expressed or implied and confer no rights.

Microsoft MVP

My MVP Profile

I'm a VB!

Watch my interview in Seattle

My new book on VB 2015!

Pre-order VB 2015 Unleashed Pre-order my new book "Visual Basic 2015 Unleashed". Click for more info!

My new book on LightSwitch!

Visual Studio LightSwitch Unleashed My book "Visual Studio LightSwitch Unleashed" is available. Click the cover!

Your visits

Follow me on Twitter!

CodePlex download Download my open-source projects from CodePlex!

Article Categories


Post Categories

.NET Framework


Help Authoring

Microsoft & MSDN

Setup & Deployment

Visual Basic 2005/2008/2010

XAML Code Snippets

Provides support for adding XAML code snippets in the Visual Studio 2010 code editor for XAML in WPF and Silverlight projects.

The addin has been written in Visual Basic 2010 and actually targets Visual Studio 2010 RTM. It uses and creates classic .Snippet files for XML syntax. At runtime the XML markup is simply pasted as XAML in the code editor. You use it as follows:

1. to insert a code snippet, right click the code editor and select Insert XAML Code Snippet from the context menu:


2. in the appearing dialog select the folder containing your XML .Snippet files and then select the desired snippet:


Notice that if you pass the mouse over the Code cell, a tooltip will show the full markup:


3. Click Insert Snippet, and your code snippet will be added to your XAML code:


4. To export some code to a .Snippet file for XML, simply select the code and right click. Then choose the Export selection as XAML Snippet command from the context menu. In the appearing dialog specify the snippet properties and click Export:


There are some limitations: for example, the addin creates dialogs for inserting and exporting snippets. This is because the XAML code editor doesn't actually support code snippets like in VB or C# editors; then, in order to browse for snippets subfolder you need to click the "..." button each time you want to move to a different folder; another limitation is that you need to manually organize snippets in subfolders. Also, there is no support for the Code Snippet Manager tool (and the reason is still that the XAML editor has no native snippets support).

Print | posted on domenica 25 aprile 2010 03:00 | Filed Under [ My CodePlex projects ]


No comments posted yet.

Post Comment

Please add 5 and 4 and type the answer here:

Powered by:
Powered By Subtext Powered By ASP.NET