-
-
Notifications
You must be signed in to change notification settings - Fork 153
/
PaymentPage.ux
68 lines (56 loc) · 2.12 KB
/
PaymentPage.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
<Page ux:Class="PaymentPage">
<!-- A simple custom ComboBox. -->
<Panel ux:Class="ComboBox" HitTestMode="LocalBoundsAndChildren">
<object ux:Property="Items" />
<string ux:Property="Value" />
<Panel ux:Name="theOuter" Padding="5">
<Rectangle Layer="Background" Color="#BBB">
<Stroke Width="1" Color="#000" />
</Rectangle>
<Label ux:Name="theSelected" />
<Tapped>
<Set thePopup.Value="true" />
</Tapped>
</Panel>
<!-- Note, the ZOrdering of the popup only works here since our page lays out from top-to-bottom.
If you would need to overlap items before the ComboBox (thus above it), you'd need to place
this in an AlternateRoot with a LayoutMaster to this control. -->
<Panel ux:Name="theList" Visibility="Hidden" Layer="Overlay" Padding="5">
<StackPanel Color="#FAA" Alignment="Top" BoxSizing="NoImplicitMax">
<Rectangle Layer="Background" Color="#DDD">
<Stroke Width="1" Color="#000" />
</Rectangle>
<Selection Value="{Property Value}" MinCount="1" MaxCount="1" />
<Each Items="{ReadProperty Items}">
<Panel ux:Name="thePanel" Color="#0000">
<Selectable Value="{value}" />
<Label Value="{label}" />
<WhileSelected>
<Change thePanel.Color="#AFAF" />
<Change Target="theSelected.Value" Value="{label}" />
</WhileSelected>
<Tapped>
<ToggleSelection />
<Set thePopup.Value="false" />
</Tapped>
</Panel>
</Each>
</StackPanel>
</Panel>
<WhileTrue ux:Name="thePopup">
<Change theList.Visibility="Visible" />
<Change theOuter.Visibility="Hidden" />
</WhileTrue>
</Panel>
<JavaScript File="PaymentPage.js" />
<StackPanel ItemSpacing="10" Alignment="TopCenter">
<Label Value="How would you like to pay and have it delivered?" />
<Grid Columns="auto,1*" DefaultRow="auto" Margin="10" CellSpacing="10">
<Label Value="Payment" />
<ComboBox Items="{paymentOpts}" Value="{payment}" />
<Label Value="Delivery" />
<ComboBox Items="{deliveryOpts}" Value="{delivery}" />
</Grid>
<Label Value="{notice}" TextAlignment="Center" TextWrapping="Wrap" />
</StackPanel>
</Page>