Skip to content

Instantly share code, notes, and snippets.

@yonixw
Last active November 14, 2019 20:08
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 yonixw/8d00bf3d5c0fbc040d35cb6d81196891 to your computer and use it in GitHub Desktop.
Save yonixw/8d00bf3d5c0fbc040d35cb6d81196891 to your computer and use it in GitHub Desktop.
Xamarin TAG snippet with class name

In visual studio:

  1. Tools > Code Snippets Manager
  2. Import
  3. Choose .Snippet file
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippet Format="1.0.0"
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<Title>Xamarin Tag per class</Title>
<Author>Yonixw</Author>
<Shortcut>xtag</Shortcut>
<Description>Make tag with class name, Thanks to BlackWasp.co.uk</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>classname</ID>
<ToolTip>Class name</ToolTip>
<Function>ClassName()</Function>
</Literal>
</Declarations>
<Code Language="CSharp">
<![CDATA[static readonly string TAG = typeof($classname$).Name.ToString();]]></Code>
</Snippet>
</CodeSnippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment