-
Notifications
You must be signed in to change notification settings - Fork 3
/
KioskPage1.xaml.cs
109 lines (85 loc) · 3.33 KB
/
KioskPage1.xaml.cs
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
using Newtonsoft.Json;
using System.Collections.Generic;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
namespace jjangchin_kiosk
{
public partial class KioskPage1 : View
{
string Type;
public KioskPage1()
{
InitializeComponent();
Type = "Coffee";
string data = Utils.Request("/menu/beverage/");
var li = JsonConvert.DeserializeObject<List<string>>(data);
foreach (string v in li)
{
Button btn = new Button();
btn.Text = v;
btn.FontFamily = "배달의민족주아";
btn.TextColor = Color.Black;
btn.BackgroundImage = "*Resource*/images/button_background.png";
btn.Margin = new Extents(0, 20, 0, 20);
btn.Clicked += (o, i) =>
{
Window.Instance.Add(new SelectPage(v));
};
this.btnList.Add(btn);
}
}
private void Ade_Button_ClickEvent(object sender, Button e)
{
new List<View>(btnList.Children).ForEach(btnList.Remove);
if (Type != "Ade")
{
this.adeBtn.BackgroundImage = "*Resource*/images/Selectpage.png";
this.coffeeBtn.BackgroundImage = "*Resource*/images/Selectpage2.png";
string data = Utils.Request("/menu/food/");
var li = JsonConvert.DeserializeObject<List<string>>(data);
foreach (string v in li)
{
Button btn = new Button();
btn.Text = v;
btn.FontFamily = "배달의민족주아";
btn.TextColor = Color.Black;
btn.BackgroundImage = "*Resource*/images/button_background.png";
btn.Margin = new Extents(0, 20, 0, 20);
btn.Clicked += (o, i) =>
{
Window.Instance.Add(new SelectPage(v));
};
this.btnList.Add(btn);
}
}
Type = "Ade";
}
private void Coffee_Button_ClickEvent(object sender, Tizen.NUI.Components.Button e)
{
new List<View>(btnList.Children).ForEach(btnList.Remove);
if (Type != "Coffee")
{
this.adeBtn.BackgroundImage = "*Resource*/images/Selectpage2.png";
this.coffeeBtn.BackgroundImage = "*Resource*/images/Selectpage.png";
string data = Utils.Request("/menu/beverage/");
var li = JsonConvert.DeserializeObject<List<string>>(data);
foreach (string v in li)
{
Button btn = new Button();
btn.Text = v;
btn.FontFamily = "배달의민족주아";
btn.TextColor = Color.Black;
btn.BackgroundImage = "*Resource*/images/button_background.png";
btn.Margin = new Extents(0, 20, 0, 20);
btn.Clicked += (o, i) =>
{
Window.Instance.Add(new SelectPage(v));
};
this.btnList.Add(btn);
}
}
Type = "Coffee";
}
}
}