Skip to content

Instantly share code, notes, and snippets.

@chris84948
Created July 26, 2017 20:39
Show Gist options
  • Save chris84948/2e48a2d58a148e0f2f6d161a044c942e to your computer and use it in GitHub Desktop.
Save chris84948/2e48a2d58a148e0f2f6d161a044c942e to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>Converter</Title>
<Author>chris84948</Author>
<Description>
</Description>
<HelpUrl>
</HelpUrl>
<Shortcut>conv</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type1</ID>
<ToolTip>Property type</ToolTip>
<Default>double</Default>
</Literal>
<Literal>
<ID>type2</ID>
<ToolTip>Property type</ToolTip>
<Default>double</Default>
</Literal>
<Literal>
<ID>class</ID>
<ToolTip>Property type</ToolTip>
<Default>___Converter</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[[ValueConversion(typeof($type1$), typeof($type2$))]
public class $class$ : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!(value is $type1$))
return 0;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment