Skip to content

Instantly share code, notes, and snippets.

@Juansero29
Created September 25, 2019 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Juansero29/b528672cc3319a8a1620fae712858178 to your computer and use it in GitHub Desktop.
Save Juansero29/b528672cc3319a8a1620fae712858178 to your computer and use it in GitHub Desktop.
Code snippet for surrounding existing XAML with a region. It's targeted to use within Xamarin.Forms, it may not work elsewhere. Type 'sregx' to access it easily on a XAML Code Editor window. Language Version: C# 4.0 or higher
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Surround XAML with a XAML Region</Title>
<Author>Juan R. (Juansero29)</Author>
<Shortcut>sregx</Shortcut>
<Description>
Code snippet for surrounding existing XAML with a region.
It's targeted to use within Xamarin.Forms, it may not work elsewhere.
Type 'sregx' to access it easily on a XAML Code Editor window.
Language Version: C# 4.0 or higher
</Description>
<SnippetTypes>
<SnippetType>SurroundsWith</SnippetType>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal Editable="true">
<ID>RegionName</ID>
<ToolTip>Enter the name for this region</ToolTip>
<Default>MyRegion</Default>
</Literal>
</Declarations>
<Code Language="xaml">
<![CDATA[
<!--#region $RegionName$-->
$selected$
<!--#endregion-->
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment