Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@JoeM-RP
Last active April 30, 2018 20:09
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 JoeM-RP/cd4085718fd4dd997f11ba983e7a37dc to your computer and use it in GitHub Desktop.
Save JoeM-RP/cd4085718fd4dd997f11ba983e7a37dc to your computer and use it in GitHub Desktop.
Visual Studio Mac Snippets

README

To reuse templates simply copy these files to the appropriate location

VS Mac

~Library/VisualStudio/<version>/Snippets

VS Windows

%AppData%\VisualStudio\<version>\Snippets

<?xml version="1.0" encoding="utf-8"?>
<CodeTemplates version="3.0">
<CodeTemplate version="2.0">
<Header>
<_Group>C#</_Group>
<Version />
<MimeType>text/x-csharp</MimeType>
<Shortcut>isafe</Shortcut>
<_Description>SetUseSafeArea for margins on iPhone X and similar</_Description>
<TemplateType>Unknown</TemplateType>
</Header>
<Variables />
<Code><![CDATA[On<Xamarin.Forms.PlatformConfiguration.iOS>().SetUseSafeArea(true);]]></Code>
</CodeTemplate>
</CodeTemplates>
<?xml version="1.0" encoding="utf-8"?>
<CodeTemplates version="3.0">
<CodeTemplate version="2.0">
<Header>
<_Group>C#</_Group>
<Version />
<MimeType>text/x-csharp</MimeType>
<Shortcut>pprism</Shortcut>
<_Description>Template for observable property in Prism</_Description>
<TemplateType>Expansion</TemplateType>
</Header>
<Variables>
<Variable name="type">
<Default>Object</Default>
</Variable>
<Variable name="name">
<Default>_myProperty</Default>
</Variable>
<Variable name="Name">
<Default>MyProperty</Default>
</Variable>
</Variables>
<Code><![CDATA[private $type$ $name$;
public $type$ $Name$ {
get { return $name$; }
set { SetProperty(ref $name$, value); }
}]]></Code>
</CodeTemplate>
</CodeTemplates>
<?xml version="1.0" encoding="utf-8"?>
<CodeTemplates version="3.0">
<CodeTemplate version="2.0">
<Header>
<_Group>C#</_Group>
<Version />
<MimeType>text/x-csharp</MimeType>
<Shortcut>pprismr</Shortcut>
<_Description>Template for observable property in Prism that notifies another property</_Description>
<TemplateType>Expansion</TemplateType>
</Header>
<Variables>
<Variable name="type">
<Default>Object</Default>
</Variable>
<Variable name="name">
<Default>_myProperty</Default>
</Variable>
<Variable name="Name">
<Default>MyProperty</Default>
</Variable>
<Variable name="raise">
<Default>NotifyMe</Default>
</Variable>
</Variables>
<Code><![CDATA[private $type$ $name$;
public $type$ $Name$ {
get { return $name$; }
set { SetProperty(ref $name$, value, () => RaisePropertyChanged(nameof($raise$))); }
}]]></Code>
</CodeTemplate>
</CodeTemplates>
@JoeM-RP
Copy link
Author

JoeM-RP commented Apr 19, 2018

To reuse templates simply copy these files to the appropriate location

VS Mac

~Library/VisualStudio/<version>/Snippets

VS Windows

%AppData%\VisualStudio\<version>\Snippets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment