-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathclasscell.template.xml
67 lines (61 loc) · 2 KB
/
classcell.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?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>classcell</Shortcut>
<_Description>reacive view cell template</_Description>
<TemplateType>Unknown</TemplateType>
</Header>
<Variables>
<Variable name="Name">
<Default>notset</Default>
</Variable>
</Variables>
<Code><![CDATA[public class $Name$Cell : ReactiveViewCell<ViewModels.$Name$Item>
{
//using System;
//using System.Linq;
//using EightBot.BigBang.Extensions;
//using EightBot.BigBang.XamForms.Pages;
//using EightBot.BigBang.XamForms.Views;
//using ReactiveUI;
//using ReactiveUI.XamForms;
//using Xamarin.Forms;
public const int RequestedHeight = Values.Layout.StandardCellHeight;
Grid _mainLayout;
public $Name$Cell()
{
ViewModel = new ViewModels.$Name$Item();
}
protected override void SetupUserInterface()
{
_mainLayout = new Grid
{
BackgroundColor = Color.Transparent,
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
RowSpacing = Values.Layout.HalfPadding,
ColumnDefinitions = new ColumnDefinitionCollection {
new ColumnDefinition { Width = GridLength.Star },
},
RowDefinitions = new RowDefinitionCollection {
new RowDefinition { Height = GridLength.Star },
new RowDefinition { Height = GridLength.Star }
}
};
View = _mainLayout;
}
protected override void BindControls()
{
this.WhenAnyValue(x => x.ViewModel)
.IsNotNull()
.SelectUnit()
.InvokeCommand(this, x => x.ViewModel.InitializeData)
.DisposeWith(ControlBindings);
}
}]]></Code>
</CodeTemplate>
</CodeTemplates>