Search code examples
wpfsilverlightxamleditorcode-snippets

Visual Studio: Is there XAML snippets support?


Is there any way to add XAML snippets for XAML editor in Visual Studio 2010? For example I'd like to save my self from some typing and have something like this:

snippet: gr<TAB>

generates code:

<Grid>
    <Grid.RowDefinitions>

    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>

    </Grid.ColumnDefinitions>
</Grid>

Then if I type for example: rd<TAB> it should generate <RowDefinition />

Similarly, cd<TAB> should generate <ColumnDefinition />

and similarly for other XAML elements.

I think you get the idea... The point is to make these snippets available only in XAML editor of the Visual Studio. Having them in other code editors inside Visual Studio (eg. when editing .cs files) doesn't have point.


Solution

  • There is no built in support, but there is an extension to provide something similar to this.