wxr
2019-12-25 3df772e4fdd553b2954e8f3f55ce7ff5905407c3
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
using System;
using System.Collections.Generic;
using Shared.SimpleControl.R;
 
namespace Shared.SimpleControl.Phone
{
    public class UserSensorAutomationConditionSettingPage : FrameLayout
    {
        List<Common> sensorList;
        SensorAutomationDevice autonmationDevice;
        SensorAutomation sensorAutomation;
        public UserSensorAutomationConditionSettingPage (List<Common> commonList,SensorAutomationDevice ad, SensorAutomation sa)
        {
            autonmationDevice = ad;
            sensorAutomation = sa;
            sensorList = commonList;
        }
        public void ShowPage (Action<SensorAutomation> action)
        {
            this.BackgroundColor = SkinStyle.Current.MainColor;
            #region 标题
            var topView = new FrameLayout () {
                Y = Application.GetRealHeight (36),
                Height = Application.GetRealHeight (90),
                BackgroundColor = SkinStyle.Current.MainColor
            };
            AddChidren (topView);
 
            var title = new Button () {
                TextAlignment = TextAlignment.Center,
                TextID = R.MyInternationalizationString.AutomationSetting,
                TextColor = SkinStyle.Current.TextColor1,
                TextSize = 19,
            };
            topView.AddChidren (title);
 
            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,
                BackgroundColor = SkinStyle.Current.ViewColor,
                Height = Application.GetRealHeight (1136 - 126),
                ScrollEnabled = false
            };
            AddChidren (bodyScrolView);
 
            FrameLayout tipTopView = new FrameLayout () {
                Height = Application.GetRealHeight (110),
                BackgroundColor = SkinStyle.Current.ViewColor
            };
            bodyScrolView.AddChidren (tipTopView);
            Button btnTipText = new Button () {
                X = Application.GetRealWidth (60),
                Width = Application.GetRealWidth (500),
                TextID = R.MyInternationalizationString.ConditionType,
                TextColor = SkinStyle.Current.TextColor1,
                TextAlignment = TextAlignment.CenterLeft,
            };
            tipTopView.AddChidren (btnTipText);
 
            foreach (var common in sensorList) {
                var device = common as Sensor;
                RowLayout rowView = new RowLayout () {
                    Height = Application.GetRealHeight (100),
                    BackgroundColor = SkinStyle.Current.MainColor,
                };
                bodyScrolView.AddChidren (rowView);
 
                var btnPoint = new Button () {
                    Width = Application.GetMinRealAverage (10),
                    Height = Application.GetMinRealAverage (10),
                    Radius = (uint)Application.GetMinRealAverage (5),
                    X = Application.GetRealWidth (50),
                    Gravity = Gravity.CenterVertical,
                    BackgroundColor = SkinStyle.Current.TextColor1,
                    SelectedBackgroundColor = SkinStyle.Current.SelectedColor,
                };
                rowView.AddChidren (btnPoint);
 
                var btnDeviceName = new Button () {
                    Width = Application.GetRealWidth (300),
                    X = Application.GetRealWidth (80),
                    Text = device.Name,
                    TextColor = SkinStyle.Current.TextColor1,
                    SelectedTextColor = SkinStyle.Current.SelectedColor,
                    TextAlignment = TextAlignment.CenterLeft,
                };
                rowView.AddChidren (btnDeviceName);
 
                var rightButton = new Button () {
                    Width = Application.GetRealWidth (46),
                    Height = Application.GetRealHeight (47),
                    Gravity = Gravity.CenterVertical,
                    X = Application.GetRealWidth (580),
                    UnSelectedImagePath = "Item/Down.png",
                    SelectedImagePath = "Item/DownSelected.png",
                };
                rowView.AddChidren (rightButton);
 
                EventHandler<MouseEventArgs> eventHandler = (sender, e) => {
                    if (rightButton.IsSelected) {
                        btnPoint.IsSelected = rightButton.IsSelected = btnDeviceName.IsSelected = false;
                    } else {
                        MainPage.Loading.Start ("Please wait...");
                        System.Threading.Tasks.Task.Run (() => {
                            try {
                                Application.RunOnMainThread (() => {
                                    var dialogConditionTypeChoose = new Dialog ();
                                    var dialogView = new FrameLayout () {
                                        BackgroundColor = SkinStyle.Current.Black50Transparent,
                                    };
                                    dialogConditionTypeChoose.AddChidren (dialogView);
 
                                    dialogView.MouseUpEventHandler += (ddd, fff) => {
                                        btnPoint.IsSelected = rightButton.IsSelected = btnDeviceName.IsSelected = false;
                                        dialogView.RemoveAll ();
                                        dialogView.RemoveFromParent ();
                                        dialogConditionTypeChoose.Close ();
                                    };
 
                                    var levelListView = new FrameLayout () {
                                        Y = Application.GetRealHeight (1136 - 360),
                                        Height = Application.GetRealHeight (90 * 4) + 3,
                                        BackgroundColor = SkinStyle.Current.MainColor,
                                    };
                                    dialogView.AddChidren (levelListView);                                
 
                                    btnPoint.IsSelected = rightButton.IsSelected = btnDeviceName.IsSelected = true;
 
                                    EventHandler<MouseEventArgs> hander = (ddd, eee) => {
                                        dialogConditionTypeChoose.Close ();
                                        byte iddd = Convert.ToByte (((Button)ddd).Tag);
 
                                        List<byte> conditionIdList = new List<byte> ();
                                        conditionIdList.AddRange (autonmationDevice.ConditionIdList);
 
                                        //if (autonmationDevice.ConditionEnableList [iddd] == 255 || autonmationDevice.ConditionEnableList [iddd] == 0) {
                                        if (!conditionIdList.Contains (iddd)) {
                                            if (!sensorAutomation.AutomationConditionIdList.Contains (iddd)) {
                                                sensorAutomation.AutomationConditionIdList.Add (iddd);
                                                action (sensorAutomation);
                                                (Parent as PageLayout).PageIndex -= 1;
                                            } else {
                                                new Alert ("", Language.StringByID (MyInternationalizationString.SensorHadChoose),
                                                           Language.StringByID (MyInternationalizationString.Close)).Show ();
                                            }
                                        } else {
                                            new Alert ("", Language.StringByID (MyInternationalizationString.SensorHadChoose),
                                                       Language.StringByID (MyInternationalizationString.Close)).Show ();
                                        }
                                        //}
                                    };
 
                                    switch (device.Type) {
                                    case DeviceType.SensorPM25:
                                        var btnPM25Type1 = new Button () {
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceTipPM25Level1,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                            Tag = 0 
                                        };
                                        levelListView.AddChidren (btnPM25Type1);
                                        btnPM25Type1.MouseUpEventHandler += hander;
 
                                        var btnPM25Type2 = new Button () {
                                            Y = btnPM25Type1.Bottom + 1,
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceTipPM25Level2,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                            Tag = 1
                                        };
                                        levelListView.AddChidren (btnPM25Type2);
                                        btnPM25Type2.MouseUpEventHandler += hander;
 
 
                                        var btnPM25Type3 = new Button () {
                                            Y = btnPM25Type2.Bottom + 1,
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceTipPM25Level3,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                            Tag = 2
                                        };
                                        levelListView.AddChidren (btnPM25Type3);
                                        btnPM25Type3.MouseUpEventHandler += hander;
 
 
                                        var btnPM25Type4 = new Button () {
                                            Y = btnPM25Type3.Bottom + 1,
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceTipPM25Level4,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                            Tag = 3
                                        };
                                        levelListView.AddChidren (btnPM25Type4);
                                        btnPM25Type4.MouseUpEventHandler += hander;
 
                                        break;
                                    case DeviceType.SensorCO2:                            
                                        var btnCO2Type1 = new Button () {
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceTipCO2Level1,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                            Tag = 0 + 8
                                        };
                                        levelListView.AddChidren (btnCO2Type1);
                                        btnCO2Type1.MouseUpEventHandler += hander;
 
                                        var btnCO2Type2 = new Button () {
                                            Y = btnCO2Type1.Bottom + 1,
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceTipCO2Level2,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                            Tag = 1 + 8
                                        };
                                        levelListView.AddChidren (btnCO2Type2);
                                        btnCO2Type2.MouseUpEventHandler += hander;
 
                                        var btnCO2Type3 = new Button () {
                                            Y = btnCO2Type2.Bottom + 1,
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceTipCO2Level3,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                            Tag = 2 + 8
                                        };
                                        levelListView.AddChidren (btnCO2Type3);
                                        btnCO2Type3.MouseUpEventHandler += hander;
 
                                        var btnCO2Type4 = new Button () {
                                            Y = btnCO2Type3.Bottom + 1,
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceTipCO2Level4,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                            Tag = 3 + 8
                                        };
                                        levelListView.AddChidren (btnCO2Type4);
                                        btnCO2Type4.MouseUpEventHandler += hander;
                                        break;
                                    case DeviceType.SensorTVOC:
                                        var btnTVOCType1 = new Button () {
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceTVOCTipLevel1,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                            Tag = 0 + 8 + 8
                                        };
                                        levelListView.AddChidren (btnTVOCType1);
                                        btnTVOCType1.MouseUpEventHandler += hander;
 
                                        var btnTVOCType2 = new Button () {
                                            Y = btnTVOCType1.Bottom + 1,
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceTVOCTipLevel2,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                            Tag = 1 + 8 + 8
                                        };
                                        levelListView.AddChidren (btnTVOCType2);
                                        btnTVOCType2.MouseUpEventHandler += hander;
 
                                        var btnTVOCType3 = new Button () {
                                            Y = btnTVOCType2.Bottom + 1,
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceTVOCTipLevel3,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                            Tag = 2 + 8 + 8
                                        };
                                        levelListView.AddChidren (btnTVOCType3);
                                        btnTVOCType3.MouseUpEventHandler += hander;
 
                                        var btnTVOCType4 = new Button () {
                                            Y = btnTVOCType3.Bottom + 1,
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceTVOCTipLevel4,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                            Tag = 3 + 8 + 8
                                        };
                                        levelListView.AddChidren (btnTVOCType4);
                                        btnTVOCType4.MouseUpEventHandler += hander;
                                        break;
                                    case DeviceType.SensorTemperature:                                       
                                        var btnTemperatureType1 = new Button () {
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.Overheat,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                        };
                                        levelListView.AddChidren (btnTemperatureType1);
 
                                        btnTemperatureType1.MouseUpEventHandler += (te, ddd) => {
                                            levelListView.RemoveAll ();
                                            MainPage.Loading.Start ("Please wait...");
                                            System.Threading.Tasks.Task.Run (() => {
                                                try {
                                                    Application.RunOnMainThread (() => {
                                                        var TriggerTemp = Language.StringByID (R.MyInternationalizationString.TriggerTemp);
                                                        for (int i = 0; i < 4; i++) {
                                                            int pushTemp = 0;
                                                            var pushValuesRevertBytes = Control.ControlBytesSendHasReturn (Command.ReadSensorPushValues, device.SubnetID, device.DeviceID, new byte [] { device.DevicePushType, (byte)i });
                                                            if (pushValuesRevertBytes == null) {
                                                                pushValuesRevertBytes = new byte [] { device.DevicePushType, (byte)i, 0, 0, 0, 255 };
                                                            }
                                                            pushTemp = pushValuesRevertBytes [2] * 256 + pushValuesRevertBytes [3];
 
                                                            #region ---温度推送设置---
                                                            string setTemp = (pushTemp > 40448 ? ((40448 - pushTemp) / 10).ToString () : ((pushTemp / 10).ToString ())) + "°C";
                                                            Button btnTip = new Button () {
                                                                Y = Application.GetRealHeight (90) * i + i,
                                                                Height = Application.GetRealHeight (90) ,
                                                                TextColor = SkinStyle.Current.TextColor,
                                                                TextAlignment = TextAlignment.Center,
                                                                BackgroundColor = SkinStyle.Current.DialogColor,
                                                                Tag = i + 8 + 8 +8
                                                            };
                                                            levelListView.AddChidren (btnTip);
                                                            btnTip.Text = TriggerTemp + ":> " + setTemp;
                                                            btnTip.MouseUpEventHandler += hander;
                                                            #endregion
                                                        }
                                                    });
                                                } catch (Exception ex) {
                                                    Console.WriteLine (ex.Message);
                                                } finally {
                                                    Application.RunOnMainThread (() => {
                                                        MainPage.Loading.Hide ();
                                                    });
                                                }
                                            });
                                        };
 
                                        var btnTemperatureType2 = new Button () {
                                            Y = btnTemperatureType1.Bottom + 1,
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.Overcooling,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                        };
                                        levelListView.AddChidren (btnTemperatureType2);
 
 
                                        btnTemperatureType2.MouseUpEventHandler += (te, ddd) => {
                                            levelListView.RemoveAll ();
                                            MainPage.Loading.Start ("Please wait...");
                                            System.Threading.Tasks.Task.Run (() => {
                                                try {
                                                    Application.RunOnMainThread (() => {
                                                        var TriggerTemp = Language.StringByID (R.MyInternationalizationString.TriggerTemp);
                                                        for (int i = 0; i < 4; i++) {
                                                            int pushTemp = 0;
                                                            var pushValuesRevertBytes = Control.ControlBytesSendHasReturn (Command.ReadSensorPushValues, device.SubnetID, device.DeviceID, new byte [] { device.DevicePushType, (byte)i });
                                                            if (pushValuesRevertBytes == null) {
                                                                pushValuesRevertBytes = new byte [] { device.DevicePushType, (byte)i, 0, 0, 0, 255 };
                                                            }
                                                            pushTemp = pushValuesRevertBytes [4] * 256 + pushValuesRevertBytes [5];
 
                                                            #region ---温度推送设置---
                                                            string setTemp = (pushTemp > 40448 ? ((40448 - pushTemp) / 10).ToString () : ((pushTemp / 10).ToString ())) + "°C";
                                                            Button btnTip = new Button () {
                                                                Y = Application.GetRealHeight (90) * i + i,
                                                                Height = Application.GetRealHeight (90),
                                                                TextColor = SkinStyle.Current.TextColor,
                                                                TextAlignment = TextAlignment.Center,
                                                                BackgroundColor = SkinStyle.Current.DialogColor,
                                                                Tag = i + 8 + 8 + 8
                                                            };
                                                            levelListView.AddChidren (btnTip);
                                                            btnTip.Text = TriggerTemp + ":< " + setTemp;
                                                            btnTip.MouseUpEventHandler += hander;
                                                            #endregion
                                                        }
                                                    });
                                                } catch (Exception ex) {
                                                    Console.WriteLine (ex.Message);
                                                } finally {
                                                    Application.RunOnMainThread (() => {
                                                        MainPage.Loading.Hide ();
                                                    });
                                                }
                                            });
                                        };
 
                                        var btnTemNull = new Button () {
                                            Y = btnTemperatureType2.Bottom+1,
                                            Height = Application.GetRealHeight (185),
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                        };
                                        levelListView.AddChidren (btnTemNull);
                                        break;
                                    case DeviceType.SensorHumidity:
                                        var btnHumidityType1 = new Button () {
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceHumidityTipLevel3,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            Tag = 0 + 8 + 8 + 16,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                        };
                                        levelListView.AddChidren (btnHumidityType1);
                                        btnHumidityType1.MouseUpEventHandler += hander;
 
                                        var btnHumidityType2 = new Button () {
                                            Y = btnHumidityType1.Bottom + 1,
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceTempTipLevel1,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                            Tag = 1 + 8 + 8 + 16
                                        };
                                        levelListView.AddChidren (btnHumidityType2);
                                        btnHumidityType2.MouseUpEventHandler += hander;
 
                                        var btnHumidityType3 = new Button () {
                                            Y = btnHumidityType2.Bottom + 1,
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceHumidityTipLevel1,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            Tag = 2 + 8 + 8 + 16,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                        };
                                        levelListView.AddChidren (btnHumidityType3);
                                        btnHumidityType3.MouseUpEventHandler += hander;
 
                                        var btnHumidityType4 = new Button () {
                                            Y = btnHumidityType3.Bottom + 1,
                                            Height = Application.GetRealHeight (90),
                                            TextID = R.MyInternationalizationString.SensorReferenceHumidityTipLevel2,
                                            TextColor = SkinStyle.Current.TextColor,
                                            TextAlignment = TextAlignment.Center,
                                            Tag = 3 + 8 + 8 + 16,
                                            BackgroundColor = SkinStyle.Current.DialogColor,
                                        };
                                        levelListView.AddChidren (btnHumidityType4);
                                        btnHumidityType4.MouseUpEventHandler += hander;
                                        break;
                                    }
                                    dialogConditionTypeChoose.Show ();
                                });
                            } catch { } finally {
                                Application.RunOnMainThread (() => {
                                    MainPage.Loading.Hide ();
                                });
                            }
                        });
                    }
                };
 
 
 
 
                rightButton.MouseUpEventHandler += eventHandler;
                btnDeviceName.MouseUpEventHandler += eventHandler;
                rowView.MouseUpEventHandler += eventHandler;
 
 
            }
        }
    }
}