-
Notifications
You must be signed in to change notification settings - Fork 2
/
vmdetail.template.xml
69 lines (61 loc) · 1.75 KB
/
vmdetail.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
<?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>vmdetail</Shortcut>
<_Description>view model for detail pages</_Description>
<TemplateType>Unknown</TemplateType>
</Header>
<Variables>
<Variable name="Name">
<Default>notset</Default>
</Variable>
<Variable name="ModelName">
<Default>notset</Default>
</Variable>
</Variables>
<Code><![CDATA[public class $Name$ : ViewModelBase<$Name$>
{
//using System;
//using System.Reactive;
//using System.Reactive.Linq;
//using System.Runtime.Serialization;
//using System.Threading.Tasks;
//using EightBot.BigBang.Extensions;
//using EightBot.BigBang.ViewModel;
//using FluentValidation;
//using ReactiveUI;
//using Splat;
public override string Title => string.Empty;
public override AbstractValidator<$Name$> Validator => null;
$ModelName$ _data;
[DataMember]
public $ModelName$ Data
{
get => _data;
private set => this.RaiseAndSetIfChanged(ref _data, value);
}
public $Name$($ModelName$ detail)
{
Data = detail;
}
protected override void Initialize()
{
base.Initialize();
}
public ReactiveCommand<Unit> InitializeData { get; private set; }
protected override void RegisterObservables()
{
InitializeData =
ReactiveCommand
.CreateAsyncTask(_ => {
return System.Threading.Tasks.Task.FromResult(Unit.Default);
})
.DisposeWith(ViewModelBindings);
}
}]]></Code>
</CodeTemplate>
</CodeTemplates>