From 48ba446936b51fffafa7c3600c0dadc6ac0e8c20 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 10 七月 2020 10:52:13 +0800
Subject: [PATCH] 2020-07-10-01

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs |  498 ++++++++++++++++++++++++++-----------------------------
 1 files changed, 237 insertions(+), 261 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs
index 64b0b9a..45d82b8 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs
@@ -1,15 +1,15 @@
-锘縰sing System;
-using System.Threading.Tasks;
-using ZigBee.Device;
-namespace Shared.Phone.UserCenter.DevicePanel
-{
-    public class PanelFangyueFreshAirBackLightSettionForm : EditorCommonForm
-    {
+锘縰sing System;
+using System.Threading.Tasks;
+using ZigBee.Device;
+namespace Shared.Phone.UserCenter.DevicePanel
+{
+    public class PanelFangyueFreshAirBackLightSettionForm : EditorCommonForm
+    {
         #region 鈻� 鍙橀噺澹版槑___________________________
         /// <summary>
         /// 鍒楄〃鎺т欢
         /// </summary>
-        private VerticalScrolViewLayout listview = null;
+        private VerticalScrolViewLayout listview = null;
         /// <summary>
         /// 闈㈡澘鐨勫洖璺�
         /// </summary>
@@ -42,7 +42,7 @@
         public void ShowForm(Panel i_panel)
         {
             //宸︽粦浣胯兘涓嶅彲
-            this.ScrollEnabled = false;
+            this.ScrollEnabled = false;
             this.panelDevice = i_panel;
 
             //璁剧疆澶撮儴淇℃伅
@@ -56,8 +56,8 @@
         /// 鍒濆鍖栦腑閮ㄤ俊鎭�
         /// </summary>
         private async void InitMiddleFrame()
-        {
-            //鑾峰彇璁惧鍒濆鏁版嵁
+        {
+            //鑾峰彇璁惧鍒濆鏁版嵁
             var result = await this.GetDeviceDefultData();
             if (result == false)
             {
@@ -65,34 +65,34 @@
             }
 
             //娓呯┖bodyFrame
-            this.ClearBodyFrame();
-
-            listview = new VerticalScrolViewLayout();
-            listview.Height = Application.GetRealHeight(1981 - 184);
-            bodyFrameLayout.AddChidren(listview);
-
-            HdlThreadLogic.Current.RunMain(() =>
-            {
-                //娣诲姞鑺傝兘妯″紡鎺т欢
-                this.AddEnergyConservationRow();
-
-                //娣诲姞灞忓箷浜害绾у埆鎺т欢
-                this.AddScreenBrightnesLevelControl();
-                //娣诲姞鑳屽厜鐏寒搴︽帶浠躲�愭殏鏃朵笉闇�瑕侊紝鍙兘鍚庢湡鏂伴闈㈡澘鐨勮繖涓鑹茶琛ュ洖鏉ャ��
-                //this.AddBackLightControl();
-                //銆愭殏鏃朵笉闇�瑕侊紝鍙兘鍚庢湡鏂伴闈㈡澘鐨勮繖涓鑹茶琛ュ洖鏉ャ��
-                //this.FinishInitControl(listview, energyModeInfo.enable);
+            this.ClearBodyFrame();
 
-                //淇濆瓨
+            listview = new VerticalScrolViewLayout();
+            listview.Height = Application.GetRealHeight(1981 - 184);
+            bodyFrameLayout.AddChidren(listview);
+            listview.ScrollEnabled = false;
+
+            HdlThreadLogic.Current.RunMain(() =>
+            {
+                //娣诲姞鑺傝兘妯″紡鎺т欢
+                this.AddEnergyConservationRow();
+
+                //娣诲姞灞忓箷浜害绾у埆鎺т欢
+                this.AddScreenBrightnesLevelControl();
+
+                //娣诲姞鏂伴闈㈡澘鐨勯鑹�
+                this.AddColorControl();
+
+                //淇濆瓨
                 var btnSave = new BottomClickButton();
                 btnSave.TextID = R.MyInternationalizationString.uSave;
                 bodyFrameLayout.AddChidren(btnSave);
                 btnSave.ButtonClickEvent += (sender, e) =>
                 {
-                    //淇濆瓨闈㈡澘鏁版嵁
+                    //淇濆瓨闈㈡澘鏁版嵁
                     this.SavePanelData();
                 };
-            });
+            });
         }
 
         #endregion
@@ -103,13 +103,13 @@
         /// </summary>
         private void AddScreenBrightnesLevelControl()
         {
-            var btnEspace = new NormalViewControl(600, 58, true);
-            btnEspace.X = ControlCommonResourse.XXLeft;
-            listview.AddChidren(btnEspace);
-
+            var btnEspace = new NormalViewControl(600, 58, true);
+            btnEspace.X = ControlCommonResourse.XXLeft;
+            listview.AddChidren(btnEspace);
+
             var frameBack = new FrameLayout();
             frameBack.Height = Application.GetRealHeight(429);
-            frameBack.Y = Application.GetRealHeight(58);
+            frameBack.Y = Application.GetRealHeight(58);
             frameBack.BackgroundColor = UserCenterColor.Current.White;
             listview.AddChidren(frameBack);
 
@@ -152,90 +152,90 @@
             frameBack.AddChidren(seekBar1);
             seekBar1.ProgressChangedEvent += (div, value) =>
             {
-                if (value == 0)
-                {
-                    btnProgress1.Text = (value + 1).ToString();
-                }
-                else
-                {
+                if (value == 0)
+                {
+                    btnProgress1.Text = (value + 1).ToString();
+                }
+                else
+                {
                     btnProgress1.Text = value.ToString();
-                }
-
-                switch (value)
-                {
-                    case 0:
-                    case 1:
-                        linghtLevelInfo.panelDirectionsLevel = 20;
-                        btnLevel.Text = "1" + strRank;
-
-                        break;
-                    case 2:
-                        linghtLevelInfo.panelDirectionsLevel = 40;
-                        btnLevel.Text = "2" + strRank;
-                        break;
-                    case 3:
-                        linghtLevelInfo.panelDirectionsLevel = 60;
-                        btnLevel.Text = "3" + strRank;
-                        break;
-                    case 4:
-                        linghtLevelInfo.panelDirectionsLevel = 80;
-                        btnLevel.Text = "4" + strRank;
-                        break;
-                    case 5:
-                        linghtLevelInfo.panelDirectionsLevel = 100;
-                        btnLevel.Text = "5" + strRank;
-                        break;
-                }
-            };
-
-            seekBar1.OnStopTrackingTouchEvent += (div, value) =>
-            {
-                if (value == 0)
-                {
-                    seekBar1.Progress = 1;
-                }
-                else
-                {
-                    seekBar1.Progress = value;
-                }
+                }
+
+                switch (value)
+                {
+                    case 0:
+                    case 1:
+                        linghtLevelInfo.panelDirectionsLevel = 20;
+                        btnLevel.Text = "1" + strRank;
+
+                        break;
+                    case 2:
+                        linghtLevelInfo.panelDirectionsLevel = 40;
+                        btnLevel.Text = "2" + strRank;
+                        break;
+                    case 3:
+                        linghtLevelInfo.panelDirectionsLevel = 60;
+                        btnLevel.Text = "3" + strRank;
+                        break;
+                    case 4:
+                        linghtLevelInfo.panelDirectionsLevel = 80;
+                        btnLevel.Text = "4" + strRank;
+                        break;
+                    case 5:
+                        linghtLevelInfo.panelDirectionsLevel = 100;
+                        btnLevel.Text = "5" + strRank;
+                        break;
+                }
             };
 
-            if (linghtLevelInfo.panelDirectionsLevel <= 20 && linghtLevelInfo.panelDirectionsLevel >= 0)
-            {
-                btnLevel.Text = "1" + strRank;
-                btnProgress1.Text = "1";
-                seekBar1.Progress = 1;
-            }
-            else if (linghtLevelInfo.panelDirectionsLevel <= 40 && linghtLevelInfo.panelDirectionsLevel > 20)
-            {
-                btnLevel.Text = "2" + strRank;
-                btnProgress1.Text = "2";
-                seekBar1.Progress = 2;
-            }
-            else if (linghtLevelInfo.panelDirectionsLevel <= 60 && linghtLevelInfo.panelDirectionsLevel > 40)
-            {
-                btnLevel.Text = "3" + strRank;
-                btnProgress1.Text = "3";
-                seekBar1.Progress = 3;
-            }
-            else if (linghtLevelInfo.panelDirectionsLevel <= 80 && linghtLevelInfo.panelDirectionsLevel > 60)
-            {
-                btnLevel.Text = "4" + strRank;
-                btnProgress1.Text = "4";
-                seekBar1.Progress = 4;
-            }
-            else if (linghtLevelInfo.panelDirectionsLevel <= 100 && linghtLevelInfo.panelDirectionsLevel > 80)
-            {
-                btnLevel.Text = "5" + strRank;
-                btnProgress1.Text = "5";
-                seekBar1.Progress = 5;
-            }
-            else
-            {
-                btnLevel.Text = "1" + strRank;
-                btnProgress1.Text = "1";
-                seekBar1.Progress = 1;
-            }
+            seekBar1.OnStopTrackingTouchEvent += (div, value) =>
+            {
+                if (value == 0)
+                {
+                    seekBar1.Progress = 1;
+                }
+                else
+                {
+                    seekBar1.Progress = value;
+                }
+            };
+
+            if (linghtLevelInfo.panelDirectionsLevel <= 20 && linghtLevelInfo.panelDirectionsLevel >= 0)
+            {
+                btnLevel.Text = "1" + strRank;
+                btnProgress1.Text = "1";
+                seekBar1.Progress = 1;
+            }
+            else if (linghtLevelInfo.panelDirectionsLevel <= 40 && linghtLevelInfo.panelDirectionsLevel > 20)
+            {
+                btnLevel.Text = "2" + strRank;
+                btnProgress1.Text = "2";
+                seekBar1.Progress = 2;
+            }
+            else if (linghtLevelInfo.panelDirectionsLevel <= 60 && linghtLevelInfo.panelDirectionsLevel > 40)
+            {
+                btnLevel.Text = "3" + strRank;
+                btnProgress1.Text = "3";
+                seekBar1.Progress = 3;
+            }
+            else if (linghtLevelInfo.panelDirectionsLevel <= 80 && linghtLevelInfo.panelDirectionsLevel > 60)
+            {
+                btnLevel.Text = "4" + strRank;
+                btnProgress1.Text = "4";
+                seekBar1.Progress = 4;
+            }
+            else if (linghtLevelInfo.panelDirectionsLevel <= 100 && linghtLevelInfo.panelDirectionsLevel > 80)
+            {
+                btnLevel.Text = "5" + strRank;
+                btnProgress1.Text = "5";
+                seekBar1.Progress = 5;
+            }
+            else
+            {
+                btnLevel.Text = "1" + strRank;
+                btnProgress1.Text = "1";
+                seekBar1.Progress = 1;
+            }
 
             var btnTemp1 = new NormalViewControl(200, 50, true);
             btnTemp1.X = ControlCommonResourse.XXLeft;
@@ -256,144 +256,123 @@
         }
         #endregion
 
-        #region 鈻� 鑳屽厜鐏寒搴________________________
+        #region 鈻� 鑳屽厜棰滆壊_________________________
 
         /// <summary>
-        /// 娣诲姞鑳屽厜鐏寒搴︽帶浠�
+        /// 娣诲姞鑳屽厜棰滆壊鎺т欢
         /// </summary>
-        private void AddBackLightControl()
+        private void AddColorControl()
         {
-            var btnEspace = new NormalViewControl(600, 58, true);
-            btnEspace.X = ControlCommonResourse.XXLeft;
-            listview.AddChidren(btnEspace);
-
+            var btnEspace = new NormalViewControl(600, 58, true);
+            btnEspace.X = ControlCommonResourse.XXLeft;
+            listview.AddChidren(btnEspace);
+
             //鑳屾櫙
             var frameBack = new FrameLayout();
             frameBack.Y = Application.GetRealHeight(490);
-            frameBack.Height = Application.GetRealHeight(429);
+            frameBack.Height = Application.GetRealHeight(170);
             frameBack.BackgroundColor = UserCenterColor.Current.White;
             listview.AddChidren(frameBack);
 
-            //鑳屽厜鐏寒搴�
+            //鑳屽厜鐏鑹�
             var btnLevelView = new NormalViewControl(400, 60, true);
             btnLevelView.X = ControlCommonResourse.XXLeft;
             btnLevelView.Y = Application.GetRealHeight(54);
-            btnLevelView.TextID = R.MyInternationalizationString.uBacklightBrightness;
+            btnLevelView.Gravity = Gravity.CenterVertical;
+            btnLevelView.TextID = R.MyInternationalizationString.BackgroundLightColor;
             frameBack.AddChidren(btnLevelView);
 
-            //褰撳墠浜害
-            var btnProgressView1 = new NormalViewControl(200, 50, true);
-            btnProgressView1.X = ControlCommonResourse.XXLeft;
-            btnProgressView1.Y = Application.GetRealHeight(157);
-            btnProgressView1.TextSize = 12;
-            btnProgressView1.TextColor = UserCenterColor.Current.TextGrayColor1;
-            btnProgressView1.TextID = R.MyInternationalizationString.uNowLuminance;
-            frameBack.AddChidren(btnProgressView1);
-            var btnProgress1 = new NormalViewControl(200, 50, true);
-            btnProgress1.X = Application.GetRealWidth(222);
-            btnProgress1.Y = Application.GetRealHeight(157);
-            btnProgress1.TextSize = 12;
-            btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1;
-            btnProgress1.Text = "70%";
-            frameBack.AddChidren(btnProgress1);
-
-            //杩涘害鏉�
-            var seekBar1 = new SeekBarControl();
-            seekBar1.Y = Application.GetRealHeight(253);
-            frameBack.AddChidren(seekBar1);
-            seekBar1.ProgressChangedEvent += (div, value) =>
-            {
-                btnProgress1.Text = value + "%";
-            };
-            //seekBar1.Progress = linghtLevelInfo.panelBacklightLevel;
-
-            var btnTemp1 = new NormalViewControl(200, 50, true);
-            btnTemp1.X = ControlCommonResourse.XXLeft;
-            btnTemp1.Y = Application.GetRealHeight(322);
-            btnTemp1.TextSize = 12;
-            btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
-            btnTemp1.Text = "0%";
-            frameBack.AddChidren(btnTemp1);
-
-            var btnTemp2 = new NormalViewControl(200, 50, true);
-            btnTemp2.X = frameBack.Width - ControlCommonResourse.XXLeft - Application.GetRealWidth(200);
-            btnTemp2.Y = Application.GetRealHeight(322);
-            btnTemp2.TextAlignment = TextAlignment.CenterRight;
-            btnTemp2.TextSize = 12;
-            btnTemp2.TextColor = UserCenterColor.Current.TextGrayColor3;
-            btnTemp2.Text = "100%";
-            frameBack.AddChidren(btnTemp2);
-
-            var frameColor = new FrameLayoutControl();
+            var frameColor = new FrameLayoutStatuControl();
             frameColor.UseClickStatu = false;
             frameColor.Width = Application.GetRealHeight(262);
-            frameColor.Height = Application.GetMinRealAverage(79);
-            frameColor.Y = Application.GetRealHeight(26);
+            frameColor.Height = this.GetPictrueRealSize(79);
+            frameColor.Gravity = Gravity.CenterVertical;
             frameColor.X = frameBack.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262);
             frameBack.AddChidren(frameColor);
+
             //棰滆壊
-            var btnColorView = new NormalViewControl(Application.GetRealHeight(110), Application.GetMinRealAverage(50), false);
+            var btnColorView = new NormalViewControl(Application.GetRealHeight(110), this.GetPictrueRealSize(49), false);
             btnColorView.Gravity = Gravity.CenterVertical;
             btnColorView.TextAlignment = TextAlignment.CenterRight;
             btnColorView.TextSize = 12;
             btnColorView.Y = Application.GetRealHeight(5);
             btnColorView.TextColor = UserCenterColor.Current.TextGrayColor1;
             btnColorView.TextID = R.MyInternationalizationString.uColor;
-            frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEventOnly);
+            frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEvent);
 
-            int R1 = Convert.ToInt32("d8", 16);
-            int G1 = Convert.ToInt32("95", 16);
-            int B1 = Convert.ToInt32("e3", 16);
+            int R1 = Convert.ToInt32(this.keyColorData.OpenColorR, 16);
+            int G1 = Convert.ToInt32(this.keyColorData.OpenColorG, 16);
+            int B1 = Convert.ToInt32(this.keyColorData.OpenColorB, 16);
             uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1);
 
-            //棰滆壊澶栨
-            var btnColorLine = new NormalViewControl(Application.GetMinRealAverage(79), Application.GetMinRealAverage(79), false);
+            //棰滆壊澶栨 
+            var btnColorLine = new FrameLayoutStatuControl();
+            btnColorLine.Width = Application.GetRealHeight(79);
+            btnColorLine.Height = this.GetPictrueRealSize(79);
             btnColorLine.X = btnColorView.Right + Application.GetRealHeight(18);
-            btnColorLine.Radius = (uint)Application.GetMinRealAverage(79) / 2;
+            btnColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2;
             btnColorLine.BorderWidth = 1;
-            btnColorLine.BorderColor = 0xff666666;
-            frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly);
+            btnColorLine.BorderColor = 0xffcccccc;
+            frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEvent);
 
-            var btnColor = new NormalViewControl(Application.GetMinRealAverage(69), Application.GetMinRealAverage(69), false);
-            btnColor.Y = Application.GetRealHeight(5);
-            btnColor.X = btnColorView.Right + Application.GetRealHeight(23);
-            btnColor.Radius = (uint)Application.GetMinRealAverage(69) / 2;
-            btnColor.BackgroundColor = UserCenterColor.Current.ErrorColor;
-            frameColor.AddChidren(btnColor, ChidrenBindMode.BindEventOnly);
+            var btnColor = new NormalViewControl(this.GetPictrueRealSize(69), this.GetPictrueRealSize(69), false);
+            btnColor.Gravity = Gravity.Center;
+            btnColor.Radius = (uint)this.GetPictrueRealSize(69) / 2;
+            btnColor.BackgroundColor = backColor;
+            btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEvent);
 
-            //鍙樻洿婊戝姩鏉$殑棰滆壊
-            seekBar1.ProgressBarColor = backColor;
-
-            var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false);
+            var btnRight = new NormalViewControl(this.GetPictrueRealSize(58), this.GetPictrueRealSize(58), false);
             btnRight.UnSelectedImagePath = "Item/RightNext.png";
             btnRight.Y = Application.GetRealHeight(5);
-            btnRight.X = frameColor.Width - Application.GetMinRealAverage(58);
-            frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly);
-            btnRight.Y += Application.GetMinRealAverage(8);
+            btnRight.X = frameColor.Width - this.GetPictrueRealSize(58);
+            frameColor.AddChidren(btnRight, ChidrenBindMode.BindEvent);
+            btnRight.Y += this.GetPictrueRealSize(8);
 
             frameColor.ButtonClickEvent += (sender, e) =>
             {
-                var form = new PanelColorSelectForm();
-                form.AddForm(R1, G1, B1);
-                form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
-                {
-                    R1 = Rcolor;
-                    G1 = Gcolor;
-                    B1 = Bcolor;
-
-                    //this.keyColorData.CloseColorR = Convert.ToString(Rcolor, 16);
-                    //this.keyColorData.CloseColorG = Convert.ToString(Gcolor, 16);
-                    //this.keyColorData.CloseColorB = Convert.ToString(Bcolor, 16);
-
-                    btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
-                    //鍙樻洿婊戝姩鏉$殑棰滆壊
-                    seekBar1.ProgressBarColor = btnColor.BackgroundColor;
-                };
+                PanelColor(btnColor, R1, G1, B1);
             };
-        }
-
+            btnColorView.ButtonClickEvent += (sender, e) =>
+            {
+                PanelColor(btnColor, R1, G1, B1);
+            };
+            btnColor.ButtonClickEvent += (sender, e) =>
+            {
+                PanelColor(btnColor, R1, G1, B1);
+            };
+            btnColorLine.ButtonClickEvent += (sender, e) =>
+            {
+                PanelColor(btnColor, R1, G1, B1);
+            };
+            btnRight.ButtonClickEvent += (sender, e) =>
+            {
+                PanelColor(btnColor, R1, G1, B1);
+            };
+        }
+
+        /// <summary>
+        /// PanelColorSelectForm
+        /// </summary>
+        private void PanelColor(NormalViewControl btnColor, int R1, int G1, int B1)
+        {
+            var form = new PanelColorSelectForm();
+            form.AddForm(R1, G1, B1);
+            form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
+            {
+                R1 = Rcolor;
+                G1 = Gcolor;
+                B1 = Bcolor;
+
+                this.keyColorData.OpenColorR = Convert.ToString(Rcolor, 16);
+                this.keyColorData.OpenColorG = Convert.ToString(Gcolor, 16);
+                this.keyColorData.OpenColorB = Convert.ToString(Bcolor, 16);
+
+                btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
+            };
+        }
+
         #endregion
-
+
         #region 鈻� 鑺傝兘妯″紡琛宊________________________ 
         /// <summary>
         ///  娣诲姞鑺傝兘妯″紡琛�
@@ -415,19 +394,17 @@
             btnSwitch.ButtonClickEvent += (sender, e) =>
             {
                 btnSwitch.IsSelected = !btnSwitch.IsSelected;
-                energyModeInfo.enable = btnSwitch.IsSelected;
-                //灞曞紑鎴栬�呯缉灏忕殑楂樺害
+                energyModeInfo.enable = btnSwitch.IsSelected;
+                //灞曞紑鎴栬�呯缉灏忕殑楂樺害
                 var value = Application.GetRealHeight(443);
                 if (btnSwitch.IsSelected == true)
                 {
-                    frameBack.Height += value;
+                    frameBack.Height += value;
                 }
                 else
                 {
-                    frameBack.Height -= value;
+                    frameBack.Height -= value;
                 }
-                //瀹瑰櫒琛ュ厖
-                this.FinishInitControl(listview, energyModeInfo.enable);
             };
             if (energyModeInfo.enable == true)
             {
@@ -485,21 +462,21 @@
                 //灞曞紑鎴栬�呯缉灏忕殑楂樺害
                 var value = Application.GetRealHeight(443);
                 frameBack.Height += value;
-            }
-            //娣诲姞鎺ヨ繎鎰熷簲
-            this.AddProximitySensorsRow(frameBack);
-        }
-
+            }
+            //娣诲姞鎺ヨ繎鎰熷簲
+            this.AddProximitySensorsRow(frameBack);
+        }
+
         #endregion
-
+
         #region 鈻� 鎺ヨ繎鎰熷簲___________________________
-
+
         /// <summary>
         /// 鎺ヨ繎鎰熷簲琛�
         /// </summary>
         private void AddProximitySensorsRow(FrameRowControl frameRowControl)
-        {
-            //鎺ヨ繎鎰熷簲琛�
+        {
+            //鎺ヨ繎鎰熷簲琛�
             var frameBack = new FrameRowControl();
             frameBack.BackgroundColor = UserCenterColor.Current.White;
             frameBack.UseClickStatu = false;
@@ -510,18 +487,18 @@
             //鎺ヨ繎鎰熷簲
             frameBack.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.ProximitySensors), 400);
             //寮�鍏虫帶浠�
-            var btnSwitch = frameBack.AddMostRightSwitchIcon();
-
-            btnSwitch.ButtonClickEvent += (sender, e) =>
-            {
-                btnSwitch.IsSelected = !btnSwitch.IsSelected;
-                proximitySensorsInfo.enable = btnSwitch.IsSelected;
-            };
+            var btnSwitch = frameBack.AddMostRightSwitchIcon();
+
+            btnSwitch.ButtonClickEvent += (sender, e) =>
+            {
+                btnSwitch.IsSelected = !btnSwitch.IsSelected;
+                proximitySensorsInfo.enable = btnSwitch.IsSelected;
+            };
             if (proximitySensorsInfo.enable == true)
             {
                 btnSwitch.IsSelected = true;
-            }
-        }
+            }
+        }
         #endregion
 
         #region 鈻� 鑾峰彇鍒濆鏁版嵁_______________________
@@ -535,7 +512,7 @@
             //寮�鍚繘搴︽潯
             this.ShowProgressBar();
             //浜害璋冭妭(浠栦滑璇撮殢渚挎嬁涓�璺洖璺氨琛屼簡)
-            linghtLevelInfo = await HdlDevicePanelLogic.Current.GetDeviceLightSettion(panelDevice);
+            linghtLevelInfo = HdlDevicePanelLogic.Current.GetDeviceLightSettion(panelDevice);
             if (linghtLevelInfo == null)
             {
                 //鍏抽棴杩涘害鏉�
@@ -551,14 +528,14 @@
                 return false;
             }
             //鑺傝兘妯″紡(浠栦滑璇撮殢渚挎嬁涓�璺洖璺氨琛屼簡)
-            energyModeInfo = await HdlDevicePanelLogic.Current.GetDeviceEnergyConservationMode(panelDevice);
+            energyModeInfo = HdlDevicePanelLogic.Current.GetDeviceEnergyConservationMode(panelDevice);
             if (energyModeInfo == null)
             {
                 //鍏抽棴杩涘害鏉�
                 this.CloseProgressBar(ShowReLoadMode.YES);
                 return false;
             }
-            keyColorData = await HdlDevicePanelLogic.Current.GetPanelEpointColorInfo(panelDevice);
+            keyColorData = HdlDevicePanelLogic.Current.GetPanelColorInfo(panelDevice);
             if (this.keyColorData == null)
             {
                 //鍏抽棴杩涘害鏉�
@@ -585,7 +562,7 @@
             //鑺傝兘妯″紡淇敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�)
             //璁惧鍚屼簨璇存柊椋庨潰鏉块粯璁�60绉掓椂闂达紝杩欐牱鎺ヨ繎鎰熷簲鍔熻兘鎵嶅悎鐞�
             energyModeInfo.time = 60;
-            var result = await HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level);
+            var result = HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level);
             if (result == false)
             {
                 this.CloseProgressBar();
@@ -598,26 +575,25 @@
                 this.CloseProgressBar();
                 return;
             }
-
-            //浜害璋冭妭鏇存敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�)
-            result = await HdlDevicePanelLogic.Current.SetDeviceLightSettion(panelDevice, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel);
-            if (result == false)
-            {
-                this.CloseProgressBar();
-                return;
-            }
-
-            //璁剧疆鎸夐敭闈㈡澘鎸囧畾绔偣鐨勩�愭寚绀虹伅寮�鍏抽鑹层�戠殑淇℃伅
-            //result = await HdlDevicePanelLogic.Current.SetPanelEpointColorInfo(panelDevice, this.keyColorData);
-            //this.CloseProgressBar();
-            //if (result == false)
-            //{
-            //    return;
-            //}
+
+            //浜害璋冭妭鏇存敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�)
+            result = HdlDevicePanelLogic.Current.SetDeviceLightSettion(panelDevice, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel);
+            if (result == false)
+            {
+                this.CloseProgressBar();
+                return;
+            }
+
+            //璁剧疆鎸夐敭闈㈡澘棰滆壊鐨勪俊鎭�
+            result = HdlDevicePanelLogic.Current.SetPanelColorInfo(panelDevice, this.keyColorData);
+            this.CloseProgressBar();
+            if (result == false)
+            {
+                return;
+            }
             //鍏抽棴鑷韩
             this.CloseForm();
         }
-
         #endregion
 
         #region 鈻� 琛ュ厖瀹瑰櫒___________________________ 
@@ -661,4 +637,4 @@
 
         #endregion
     }
-}
+}

--
Gitblit v1.8.0