WJC
2020-03-12 c47c3ec2488961b3a006aaebcb03dba582f8b19b
ZigbeeApp/Shared/Phone/Device/CommonForm/CategoryFunctionForWinRow.cs
@@ -1,6 +1,7 @@
using System;
using Shared.Common;
using ZigBee.Device;
namespace Shared.Phone.Device.CommonForm
{
    public class CategoryFunctionForWinRow:FrameLayout
@@ -52,7 +53,7 @@
                v_Selected = value;
                try
                {
                    SetOnLineStatu(v_Selected);
                    SetStatu(v_Selected);
                }
                catch
                {
@@ -74,15 +75,15 @@
            X = Application.GetRealWidth(x);
            Y = Application.GetRealHeight(y);
            Width = Application.GetRealWidth(1022);
            Height = Application.GetRealHeight(127);
            BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
            Height = Application.GetRealHeight(127-2);
            //BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
        }
        /// <summary>
        /// Init
        /// </summary>
        /// <param name="device"></param>
        public void Init(DeviceUI device)
        public void Init(CommonDevice device)
        {
            ImageBG = new Button()
            {
@@ -116,6 +117,7 @@
                TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                SelectedTextColor = ZigbeeColor.Current.GXCTextSelectedColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize=14
            };
            AddChidren(NameBtn);
@@ -126,7 +128,8 @@
                Width = Application.GetRealWidth(400),
                Height = Application.GetRealHeight(49),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2
                TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2,
                TextSize=10
            };
            AddChidren(StatuBtn);
@@ -142,7 +145,7 @@
            AddChidren(OpenOrUpBtn);
            OpenOrUpBtn.MouseUpEventHandler += (sender, e) =>
            {
                (device.CommonDevice as ZigBee.Device.Rollershade).CurtainUpDownStopControl(0);
                (device as ZigBee.Device.Rollershade).CurtainUpDownStopControl(0);
            };
            StopBtn = new Button
@@ -157,7 +160,7 @@
            AddChidren(StopBtn);
            StopBtn.MouseUpEventHandler += (sender, e) =>
            {
                (device.CommonDevice as ZigBee.Device.Rollershade).CurtainUpDownStopControl(2);
                (device as ZigBee.Device.Rollershade).CurtainUpDownStopControl(2);
            };
            CloseOrDownBtn = new Button
@@ -172,16 +175,16 @@
            AddChidren(CloseOrDownBtn);
            CloseOrDownBtn.MouseUpEventHandler += (sender, e) =>
            {
                (device.CommonDevice as ZigBee.Device.Rollershade).CurtainUpDownStopControl(1);
                (device as ZigBee.Device.Rollershade).CurtainUpDownStopControl(1);
            };
            var line = new Button()
            {
                X = Application.GetRealWidth(200),
                Y = Height - 2,
                X = Application.GetRealWidth(181),
                Y = Height - 1,
                Width = Application.GetRealWidth(821),
                Height = 2,
                BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor,
                Height = 1,
                BackgroundColor = ZigbeeColor.Current.GXCGrayLineColor2,
                Tag = Tag
            };
            AddChidren(line);
@@ -224,7 +227,9 @@
        /// <param name="statu"></param>
        public void SetStatu(bool statu)
        {
            OpenOrUpBtn.IsSelected = CloseOrDownBtn.IsSelected = StopBtn.IsSelected = statu;
            //OpenOrUpBtn.IsSelected = CloseOrDownBtn.IsSelected = StopBtn.IsSelected = statu;
            NameBtn.IsSelected = ImageBG.IsSelected = ImageBtn.IsSelected = statu;
            NameBtn.IsBold = statu;
        }
        /// <summary>
@@ -234,7 +239,7 @@
        public void SetOnLineStatu(bool statu)
        {
            NameBtn.IsSelected = ImageBG.IsSelected = ImageBtn.IsSelected = statu;
            NameBtn.IsBold = statu;
        }
        /// <summary>
@@ -270,5 +275,18 @@
                CloseOrDownBtn.SelectedImagePath = "RollerShade/CloseSelected.png";
            }
        }
        /// <summary>
        /// SetDeviceIcon
        /// </summary>
        /// <param name="imagePath"></param>
        /// <param name="selectedImagePath"></param>
        public void SetDeviceIcon(string imagePath, string selectedImagePath)
        {
            ImageBtn.UnSelectedImagePath = imagePath;
            ImageBtn.SelectedImagePath = selectedImagePath;
        }
    }
}