JLChen
2020-06-05 f86c8b5dcf5c84386745b009fc4115fa9db3b76d
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
//using System;
//using System.Collections.Generic;
 
//namespace Shared.SimpleControl.Phone
//{
//    public class UserSensorAutomationDeviceTypeChoose : FrameLayout
//    {
//        SensorAutomation sensorAutomation;
//        Action<SensorAutomation> action;
//        public UserSensorAutomationDeviceTypeChoose(SensorAutomation sa, Action<SensorAutomation> ac)
//        {
//            sensorAutomation = sa;
//            action = ac;
//        }
 
//        /// <summary>
//        /// 加载手机上的设备列表,配置自动化界面
//        /// </summary>
//        public void ShowPage ()
//        {
//            FrameLayout bodyView = new FrameLayout () {
//                BackgroundColor = SkinStyle.Current.MainColor,
//            };
//            AddChidren (bodyView);
//            #region 标题
//            var topView = new FrameLayout () {
//                Y = Application.GetRealHeight (36),
//                Height = Application.GetRealHeight (90),
//                BackgroundColor = SkinStyle.Current.MainColor
//            };
//            bodyView.AddChidren (topView);
 
//            var logo = new Button () {
//                Width = Application.GetRealWidth (154),
//                Height = Application.GetRealHeight (90),
//                X = Application.GetRealWidth (486),
//                UnSelectedImagePath = MainPage.LogoString,
//            };
//            topView.AddChidren (logo);
//            var back = new Button () {
//                Height = Application.GetRealHeight (90),
//                Width = Application.GetRealWidth (85),
//                UnSelectedImagePath = "Item/Back.png",
//                SelectedImagePath = "Item/BackSelected.png",
//            };
//            topView.AddChidren (back);
//            back.MouseUpEventHandler += (sender, e) => {
//                (Parent as PageLayout).PageIndex -= 1;
//            };
//            #endregion
 
//            var bodyScrolView = new VerticalScrolViewLayout () {
//                Y = topView.Bottom,
//                Height = Application.GetRealHeight (Application.DesignHeight - 126),
//                BackgroundColor = SkinStyle.Current.ViewColor,
//                ScrollEnabled = false
//            };
//            bodyView.AddChidren (bodyScrolView);
 
//            Button btnTipChooseType = new Button () {
//                X = Application.GetRealWidth (60),
//                Height = Application.GetRealHeight(100),
//                TextAlignment = TextAlignment.CenterLeft,
//                TextID = R.MyInternationalizationString.PlsSelectDeviceType,
//                TextSize = 16,
//                TextColor = SkinStyle.Current.TextColor1,
//            };
//            bodyScrolView.AddChidren (btnTipChooseType);
 
//            #region  灯光类型
//            var rowLightView = new RowLayout () {
//                Height = Application.GetRealHeight (100),
//                BackgroundColor = SkinStyle.Current.MainColor,
//            };
//            bodyScrolView.AddChidren (rowLightView);
 
//            var btnLightType = new Button () {
//                Width = Application.GetRealWidth (400),
//                TextColor = SkinStyle.Current.TextColor1,
//                TextID = R.MyInternationalizationString.Lights,
//                SelectedTextColor = SkinStyle.Current.SelectedColor,
//                TextAlignment = TextAlignment.CenterLeft,
//                X = Application.GetRealWidth (60),
//            };
//            rowLightView.AddChidren (btnLightType);
 
//            var rightButton = new Button () {
//                Width = Application.GetRealWidth (28),
//                Height = Application.GetRealHeight (40),
//                Gravity = Gravity.CenterVertical,
//                X = Application.GetRealWidth (580),
//                UnSelectedImagePath = "Item/Right.png",
//                SelectedImagePath = "Item/RightSelected.png",
//            };
//            rowLightView.AddChidren (rightButton);
 
//            EventHandler<MouseEventArgs> eventHandlerLights = (ddd, fff) => {
//                var usp = new UserSensorAutomationDeviceSetPage (sensorAutomation, action);
//                UserMiddle.DevicePageView.AddChidren (usp);
//                usp.ShowPage ("Light");
//                UserMiddle.DevicePageView.PageIndex = UserMiddle.DevicePageView.ChildrenCount - 1;
//            };
//            rowLightView.MouseUpEventHandler += eventHandlerLights;
//            btnLightType.MouseUpEventHandler += eventHandlerLights;
//            rightButton.MouseUpEventHandler += eventHandlerLights;
//            #endregion
 
//            #region 窗帘
//            var rowCurtainView = new RowLayout () {
//                Height = Application.GetRealHeight (100),
//                BackgroundColor = SkinStyle.Current.MainColor,
//            };
//            bodyScrolView.AddChidren (rowCurtainView);
 
//            var btnCurtainType = new Button () {
//                Width = Application.GetRealWidth (400),
//                TextColor = SkinStyle.Current.TextColor1,
//                TextID = R.MyInternationalizationString.Curtain,
//                SelectedTextColor = SkinStyle.Current.SelectedColor,
//                TextAlignment = TextAlignment.CenterLeft,
//                X = Application.GetRealWidth (60),
//            };
//            rowCurtainView.AddChidren (btnCurtainType);
 
//            var btnCurtainRight = new Button () {
//                Width = Application.GetRealWidth (28),
//                Height = Application.GetRealHeight (40),
//                Gravity = Gravity.CenterVertical,
//                X = Application.GetRealWidth (580),
//                UnSelectedImagePath = "Item/Right.png",
//                SelectedImagePath = "Item/RightSelected.png",
//            };
//            rowCurtainView.AddChidren (btnCurtainRight);
//            EventHandler<MouseEventArgs> eventHandlerCurtain = (ddd, fff) => {
//                var usp = new UserSensorAutomationDeviceSetPage (sensorAutomation, action);
//                UserMiddle.DevicePageView.AddChidren (usp);
//                usp.ShowPage ("Curatin");
//                UserMiddle.DevicePageView.PageIndex = UserMiddle.DevicePageView.ChildrenCount - 1;
//            };
//            rowCurtainView.MouseUpEventHandler += eventHandlerCurtain;
//            btnCurtainType.MouseUpEventHandler += eventHandlerCurtain;
//            btnCurtainRight.MouseUpEventHandler += eventHandlerCurtain;
//            #endregion
 
//            #region 空调
//            var rowACView = new RowLayout () {
//                Height = Application.GetRealHeight (100),
//                BackgroundColor = SkinStyle.Current.MainColor,
//            };
//            bodyScrolView.AddChidren (rowACView);
//            var btnACType = new Button () {
//                TextColor = SkinStyle.Current.TextColor1,
//                TextID = R.MyInternationalizationString.AC,
//                SelectedTextColor = SkinStyle.Current.SelectedColor,
//                TextAlignment = TextAlignment.CenterLeft,
//                X = Application.GetRealWidth (60),
//            };
//            rowACView.AddChidren (btnACType);
//            var btnACRight = new Button () {
//                Width = Application.GetRealWidth (28),
//                Height = Application.GetRealHeight (40),
//                Gravity = Gravity.CenterVertical,
//                X = Application.GetRealWidth (580),
//                UnSelectedImagePath = "Item/Right.png",
//                SelectedImagePath = "Item/RightSelected.png",
//            };
//            rowACView.AddChidren (btnACRight);
//            EventHandler<MouseEventArgs> eventHandlerAC = (ddd, fff) => {
//                var usp = new UserSensorAutomationDeviceSetPage (sensorAutomation, action);
//                UserMiddle.DevicePageView.AddChidren (usp);
//                usp.ShowPage ("AC");
//                UserMiddle.DevicePageView.PageIndex = UserMiddle.DevicePageView.ChildrenCount - 1;
//            };
//            rowACView.MouseUpEventHandler += eventHandlerAC;
//            btnACType.MouseUpEventHandler += eventHandlerAC;
//            btnACRight.MouseUpEventHandler += eventHandlerAC;
//            #endregion
//            #region 地热
//            var rowFoolHeatView = new RowLayout () {
//                Height = Application.GetRealHeight (100),
//                BackgroundColor = SkinStyle.Current.MainColor,
//            };
//            bodyScrolView.AddChidren (rowFoolHeatView);
//            var btnFoolHeatType = new Button () {
//                Width = Application.GetRealWidth (400),
//                TextColor = SkinStyle.Current.TextColor1,
//                TextID = R.MyInternationalizationString.FoolHeat,
//                SelectedTextColor = SkinStyle.Current.SelectedColor,
//                TextAlignment = TextAlignment.CenterLeft,
//                X = Application.GetRealWidth (60),
//            };
//            rowFoolHeatView.AddChidren (btnFoolHeatType);
//            var btnFoolHeatRight = new Button () {
//                Width = Application.GetRealWidth (28),
//                Height = Application.GetRealHeight (40),
//                Gravity = Gravity.CenterVertical,
//                X = Application.GetRealWidth (580),
//                UnSelectedImagePath = "Item/Right.png",
//                SelectedImagePath = "Item/RightSelected.png",
//            };
//            rowFoolHeatView.AddChidren (btnFoolHeatRight);
//            EventHandler<MouseEventArgs> eventHandlerFoolHeat = (ddd, fff) => {
//                var usp = new UserSensorAutomationDeviceSetPage (sensorAutomation, action);
//                UserMiddle.DevicePageView.AddChidren (usp);
//                usp.ShowPage ("FoolHeat");
//                UserMiddle.DevicePageView.PageIndex = UserMiddle.DevicePageView.ChildrenCount - 1;
//            };
//            rowFoolHeatView.MouseUpEventHandler += eventHandlerFoolHeat;
//            btnFoolHeatType.MouseUpEventHandler += eventHandlerFoolHeat;
//            btnFoolHeatRight.MouseUpEventHandler += eventHandlerFoolHeat;
//            #endregion
//            var deviceScrolView = new VerticalScrolViewLayout () {
//                Y = bodyScrolView.Bottom,
//                Height = Application.GetRealHeight (Application.DesignHeight - 126 - 120 - 110),
//                BackgroundColor = SkinStyle.Current.ViewColor,
//            };
//            bodyView.AddChidren (deviceScrolView);
 
//        }
//    }
//}