Last active
May 22, 2020 17:08
-
-
Save andreas-nesheim/ec15aa4a57d689dec1cc17a274191357 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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