Skip to content

Instantly share code, notes, and snippets.

@andreas-nesheim
Last active May 22, 2020 17: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 andreas-nesheim/ec15aa4a57d689dec1cc17a274191357 to your computer and use it in GitHub Desktop.
Save andreas-nesheim/ec15aa4a57d689dec1cc17a274191357 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>
<Title>ListView Template</Title>
<Author>Andreas Nesheim</Author>
<Description>Snippet for creating a simple ListView with a bindable ItemsSource</Description>
<Shortcut>lv</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal Editable="true">
<ID>ListName</ID>
<ToolTip>Name of the ItemsSource to bind to</ToolTip>
<Default>Items</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>PropertyName</ID>
<ToolTip>Name of the property in the ItemsSource to bind to</ToolTip>
<Default>Name</Default>
<Function>
</Function>
</Literal>
</Declarations>
<Code Language="XAML">
<![CDATA[<ListView ItemsSource="{Binding $ListName$}">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding $PropertyName$}"/>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment