-
-
Notifications
You must be signed in to change notification settings - Fork 153
/
ToppingsPage.ux
76 lines (58 loc) · 2.14 KB
/
ToppingsPage.ux
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
<Page ux:Class="ToppingsPage">
<JavaScript>
var Observable = require("FuseJS/Observable")
var current = Observable("");
var sel = Observable();
sel.onValueChanged(module, function() {
current.value = "Selected: " + sel.toArray().join(", ");
});
module.exports = {
current: current,
sel: sel
};
</JavaScript>
<StackPanel ItemSpacing="10">
<Label Value="Select up to 3 additional toppings" />
<Panel Margin="5">
<ColumnLayout ColumnSize="80" ColumnSpacing="7" ItemSpacing="7" Sizing="Fill" />
<Selection Values="{sel}" MaxCount="3" />
<Panel ux:Class="Topping" Padding="5" BoxSizing="FillAspect">
<string ux:Property="Value" />
<FileSource ux:Property="File" />
<Selectable Value="{ReadProperty Value}"/>
<Rectangle ux:Name="theBack" CornerRadius="5" Layer="Background" Color="#FFF" />
<Image ux:Name="theImage" File="{ReadProperty File}" Margin="10" />
<WhileSelected>
<Change theBack.Color="#CAF" Duration="0.2" />
</WhileSelected>
<Tapped>
<ToggleSelection />
</Tapped>
<Selected>
<Scale Target="theImage" Factor="1.2" Duration="0.3" />
</Selected>
<Deselected>
<Scale Target="theImage" Factor="0.5" Duration="0.3" />
<Change theImage.Color="#800" Duration="0.3" />
</Deselected>
</Panel>
<Topping File="Assets/basil.png" Value="basil" />
<Topping File="Assets/green_olives.png" Value="green olives" />
<Topping File="Assets/ham.png" Value="ham" />
<Topping File="Assets/onions.png" Value="onions" />
<Topping File="Assets/salami.png" Value="salami" />
<Topping File="Assets/black_olives.png" Value="black olives" />
<Topping File="Assets/green_pepper.png" Value="green peppers" />
<Topping File="Assets/mushrooms.png" Value="mushrooms" />
<Topping File="Assets/pineapple.png" Value="pineapple" />
<Topping File="Assets/red_pepper.png" Value="red peppers" />
<Topping File="Assets/tomato.png" Value="tomatos" />
</Panel>
<Label Value="{current}" />
<PizzaButton Alignment="BottomRight" Text="Delivery">
<Clicked>
<GoBack/>
</Clicked>
</PizzaButton>
</StackPanel>
</Page>