Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Owner

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