gxc
2019-11-07 a4924de3136289d10cabbf2f61a228387d44ded7
ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -653,7 +653,12 @@
        /// <param name="sender">Sender.</param>
        /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
        private void AutomationBtn_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs)
        {
        {
            Common.Logic.LogicDviceList.Clear();
            if (Common.Logic.LogicDviceList.Count == 0)
            {
                Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
            }
            functionBtn.IsSelected = false;
            sceneBtn.IsSelected = false;
            automationBtn.IsSelected = true;
@@ -1935,12 +1940,7 @@
                            }
                            else
                            {
                                Common.Logic.LogicDviceList.Clear();
                                if (Common.Logic.LogicDviceList.Count == 0)
                                {
                                    Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
                                }
                                Common.Logic.CurrentLogic.LogicType = 2;
                                Common.Logic.CurrentLogic.LogicName = logicnameBtn.Text;
                                Logic.TemplatePage templatePage = new Logic.TemplatePage();
                                Logic.TemplatePage.s = logiciocnBtn.Tag.ToString();
@@ -1959,7 +1959,7 @@
                    Yheight = 0;
                }
                logicScrolView.Y = scenehorizontalScrol.Bottom + Yheight;
                logicScrolView.Height = functionSceneBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight;
                logicScrolView.Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight;
                Automationview(logicScrolView);
            };
@@ -1985,6 +1985,7 @@
            //自动化
            Automationview(logicScrolView);
            CommonPage.Loading.Hide();
        }
        /// <summary>
@@ -1996,32 +1997,26 @@
            refresview.RemoveAll();
            foreach (var logic in Common.Logic.LogicList)
            {
                var bjRow = new RowLayout
                {
                    Width = Application.GetRealWidth(1080 - 58),
                    Height = Application.GetRealHeight(220),
                    LineColor = ZigbeeColor.Current.LogicBackgroundColor,
                    BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
                };
                refresview.AddChidren(bjRow);
                var logicRowlayout = new RowLayout
                {
                    Y = Application.GetRealHeight(220 - 190),
                    Height = Application.GetRealHeight(190),
                    Width = Application.GetRealWidth(1080 - 58 - 46),
                    LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
                    X = Application.GetRealWidth(46),
                    Height = Application.GetRealHeight(190 + 30),
                    Width = Application.GetRealWidth(1080),
                    LineColor = ZigbeeColor.Current.LogicBackgroundColor,
                    BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
                };
                bjRow.AddChidren(logicRowlayout);
                refresview.AddChidren(logicRowlayout);
                var logicnameBtn = new Button
                {
                    Height = Application.GetRealHeight(58),
                    Width = Application.GetRealWidth(350),
                    Text = logic.LogicName,
                    X = Application.GetRealWidth(12),
                    X = Application.GetRealWidth(12 + 46),
                    Y = Application.GetRealHeight(30),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                };
@@ -2034,8 +2029,8 @@
                    Height = Application.GetMinRealAverage(63),
                    UnSelectedImagePath = "ZigeeLogic/logicclose.png",
                    SelectedImagePath = "ZigeeLogic/logicopen.png",
                    X = logicRowlayout.Width - Application.GetRealWidth(104 + 58),
                    Y = Application.GetRealHeight(58 + 30 + 9),
                    X = logicRowlayout.Width - Application.GetRealWidth(104 + 58 + 58),
                    Y = Application.GetRealHeight(58 + 30 + 9 + 30),
                };
                logicRowlayout.AddChidren(logicswitchBtn);
@@ -2079,11 +2074,6 @@
                logicRowlayout.AddRightView(edit);
                edit.MouseUpEventHandler += (sender, e) =>
                {
                    Common.Logic.LogicDviceList.Clear();
                    if (Common.Logic.LogicDviceList.Count == 0)
                    {
                        Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
                    }
                    Common.Logic.CurrentLogic = logic;
                    var logicCommunalPage = new Logic.LogicCommunalPage();
                    HomePage.Instance.AddChidren(logicCommunalPage);
@@ -2117,19 +2107,32 @@
                    alert.Show();
                };
                var line = new Button
                {
                    Y = Application.GetRealHeight(215),
                    Height = Application.GetRealHeight(5),
                    Width = Application.GetRealWidth(1080 - 58),
                    BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
                    X = Application.GetRealWidth(58),
                };
                logicRowlayout.AddChidren(line);
            }
        }
        /// <summary>
        /// 显示图标的颜色
        /// </summary>
        /// <param name="logic"></param>
        /// <param name="logicRowlayout"></param>
        /// <param name="intvalue"></param>
        private void StatusColor(Common.Logic logic, RowLayout logicRowlayout, int intvalue)
        {
            var logictimeBtn = new Button
            {
                Height = Application.GetRealHeight(58),
                Width = logicRowlayout.Width - Application.GetRealWidth(58 + 12 + 350),
                Width = logicRowlayout.Width - Application.GetRealWidth(58 + 12 + 350 + 58),
                Y = Application.GetRealHeight(30),
                X = Application.GetRealWidth(365),
                TextAlignment = TextAlignment.CenterRight,
                TextColor = ZigbeeColor.Current.LogicListWeekTextColor,
@@ -2420,8 +2423,8 @@
                {
                    Width = Application.GetRealWidth(82),
                    Height = Application.GetRealHeight(82),
                    X = Application.GetRealWidth(12 + (12 + 82 + 45 + 12) * i),
                    Y = Application.GetRealHeight(58 + 30),
                    X = Application.GetRealWidth(58) + Application.GetRealWidth(12 + (12 + 82 + 45 + 12) * i),
                    Y = Application.GetRealHeight(58 + 30 + 30),
                    Radius = (uint)Application.GetRealHeight(41),
                    BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
                };
@@ -2439,7 +2442,7 @@
                var connectIconBtn = new Button
                {
                    Y = typebjBtn.Y + Application.GetRealHeight(35),
                    X = Application.GetRealWidth((12 + 82 + 12) + (12 + 45 + 82 + 12) * i),
                    X = Application.GetRealWidth(58) + Application.GetRealWidth((12 + 82 + 12) + (12 + 45 + 82 + 12) * i),
                    Width = Application.GetRealWidth(48),
                    Height = Application.GetRealHeight(15),
                    UnSelectedImagePath = "ZigeeLogic/connect.png",
@@ -2589,5 +2592,7 @@
        }
        #endregion
    }
}