-
Notifications
You must be signed in to change notification settings - Fork 1
/
lib-uwp.ammy
93 lines (78 loc) · 2.5 KB
/
lib-uwp.ammy
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
mixin TwoColumns (one = "*", two = "*") for Grid {
combine ColumnDefinitions: [
ColumnDefinition { Width: $one }
ColumnDefinition { Width: $two }
]
}
mixin ThreeColumns (one = none, two = none, three = none) for Grid {
#TwoColumns($one, $two)
combine ColumnDefinitions: ColumnDefinition { Width: $three }
}
mixin FourColumns (one = none, two = none, three = none, four = none) for Grid {
#ThreeColumns($one, $two, $three)
combine ColumnDefinitions: ColumnDefinition { Width: $four }
}
mixin FiveColumns (one = none, two = none, three = none, four = none, five = none) for Grid {
#FourColumns($one, $two, $three, $four)
combine ColumnDefinitions: ColumnDefinition { Width: $five }
}
mixin TwoRows (one = none, two = none) for Grid
{
combine RowDefinitions: [
RowDefinition { Height: $one }
RowDefinition { Height: $two }
]
}
mixin ThreeRows (one = none, two = none, three = none) for Grid
{
#TwoRows($one, $two)
combine RowDefinitions: RowDefinition { Height: $three }
}
mixin FourRows (one = none, two = none, three = none, four = none) for Grid
{
#ThreeRows($one, $two, $three)
combine RowDefinitions: RowDefinition { Height: $four }
}
mixin FiveRows (one = none, two = none, three = none, four = none, five = none) for Grid
{
#FourRows($one, $two, $three, $four)
combine RowDefinitions: RowDefinition { Height: $five }
}
mixin Cell (row = none, column = none, rowSpan = none, columnSpan = none) for FrameworkElement {
Grid.Row: $row
Grid.Column: $column
Grid.RowSpan: $rowSpan
Grid.ColumnSpan: $columnSpan
}
mixin Setter(property, value, targetName=none) for Style {
Setter { Property: $property, Value: $value, Target: $targetName }
}
/*
mixin AddSetter(property, value, targetName=none) for Style {
combine Setters: #Setter($property, $value, $targetName) {}
}*/
alias StackPanelHorizontal() {
StackPanel {
Orientation: Horizontal
}
}
alias DoubleAnimation(property, frm = "0", to = "1", duration = "0:0:1", targetName=none, beginTime=none) {
DoubleAnimation {
Storyboard.TargetProperty: $property
Storyboard.TargetName: $targetName
From: $frm
To: $to
Duration: $duration
BeginTime: $beginTime
}
}
alias DoubleAnimationStoryboard (property, frm = "0", to = "1", duration = "0:0:1", targetName=none) {
BeginStoryboard {
Storyboard {
@DoubleAnimation($property, $frm, $to, $duration, $targetName) {}
}
}
}
mixin MergeDictionary (source) for ResourceDictionary {
combine MergedDictionaries: ResourceDictionary { Source: $source }
}