Skip to content

Instantly share code, notes, and snippets.

@chris84948
Created July 26, 2017 20:42
Show Gist options
  • Save chris84948/e535112641235a87e71cde838959948b to your computer and use it in GitHub Desktop.
Save chris84948/e535112641235a87e71cde838959948b 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>MultiConverter</Title>
<Author>chris84948</Author>
<Description>
</Description>
<HelpUrl>
</HelpUrl>
<Shortcut>mconv</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[public class $class$ : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (!(values[0] is $type1$) || !(values[1] is $type2$))
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