-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbindpicker.template.xml
42 lines (42 loc) · 1.41 KB
/
bindpicker.template.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?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>bindpicker</Shortcut>
<_Description>bind picker</_Description>
<TemplateType>Unknown</TemplateType>
</Header>
<Variables>
<Variable name="pickerName">
<Default>pickerName</Default>
<_ToolTip>Picker Name</_ToolTip>
</Variable>
<Variable name="CollectionName">
<Default>CollectionName</Default>
<_ToolTip>Collection Name</_ToolTip>
</Variable>
<Variable name="SelectedProperty">
<Default>SelectedProperty</Default>
<_ToolTip>Selected Property</_ToolTip>
</Variable>
<Variable name="Value">
<Default>Value</Default>
<_ToolTip>Value</_ToolTip>
</Variable>
<Variable name="DisplayValue">
<Default>DisplayValue</Default>
<_ToolTip>Display Value</_ToolTip>
</Variable>
</Variables>
<Code><![CDATA[this._$pickerName$.Picker
.Bind(
this.WhenAnyValue(x => x.ViewModel.$Collection$),
x => ViewModel.$SelectedProperty$ = x.$Value$,
x => ViewModel.$SelectedProperty$ == x.$Value$,
x => x.$DisplayValue$)
.DisposeWith(ControlBindings);$end$]]></Code>
</CodeTemplate>
</CodeTemplates>