-
Notifications
You must be signed in to change notification settings - Fork 2
/
classui.template.xml
73 lines (65 loc) · 2.25 KB
/
classui.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
68
69
70
71
72
73
<?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>classui</Shortcut>
<_Description>eight bot class ui template</_Description>
<TemplateType>Unknown</TemplateType>
</Header>
<Variables>
<Variable name="Name">
<Default>ClassName</Default>
</Variable>
</Variables>
<Code><![CDATA[public class $Name$ : ContentPageBase<ViewModels.$Name$>
{
//using System;
//using System.Reactive.Linq;
//using EightBot.BigBang.Extensions;
//using EightBot.BigBang.XamForms.Extensions;
//using EightBot.BigBang.XamForms.Pages;
//using EightBot.BigBang.XamForms.Views;
//using ReactiveUI;
//using Xamarin.Forms;
Grid _mainLayout;
public $Name$()
{
ViewModel = new ViewModels.$Name$();
}
protected override void SetupUserInterface()
{
NavigationPage.SetBackButtonTitle(this, "Back");
_mainLayout = new Grid
{
BackgroundColor = Color.Transparent,
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Margin = new Thickness(Values.Layout.Padding, Values.Layout.TriplePadding, Values.Layout.Padding, Values.Layout.Padding),
ColumnSpacing = Values.Layout.Padding,
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 }
}
};
Content = _mainLayout;
}
protected override void BindControls()
{
this.OneWayBind(ViewModel, x => x.Title, c => c.Title)
.DisposeWith(ControlBindings);
this.WhenAnyValue(x => x.ViewModel)
.IsNotNull()
.SelectUnit()
.InvokeCommand(this, x => x.ViewModel.InitializeData)
.DisposeWith(ControlBindings);
}
}]]></Code>
</CodeTemplate>
</CodeTemplates>