xm
2020-04-16 6fa9d69da922c8049f5acfcbb9ce9fd26811024c
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs
old mode 100755 new mode 100644
@@ -5,19 +5,8 @@
using static ZigBee.Device.BindObj;
namespace Shared.Phone.UserCenter.DeviceBind
{
    public class ChooseKeyModePage : BindCommonLayout, ZigBee.Common.IStatus
    public class ChooseKeyModePage : BindCommonLayout
    {
        /// <summary>
        /// 按键模式接收
        /// </summary>
        /// <param name="common">Common.</param>
        public void Changed(CommonDevice common)
        {
            Shared.Application.RunOnMainThread(() =>
            {
            });
        }
        /// 构造函数
        /// </summary>
        /// <param name="doorLock"></param>
@@ -29,23 +18,46 @@
            this.targetList = targetSelectList;
        }
        #region ◆ 变量申明__________________________
        ZigBee.Device.Panel currentKey;//当前按键
        //显示被绑定设备或场景的view
        VerticalScrolViewLayout midVerticalScrolViewLayout;//中部刷新列表
        HorizontalScrolViewLayout btnHorizontalScrolViewLayout;//房间列表左右滑动布局
        #region 变量申明
        /// <summary>
        /// 当前按键
        /// </summary>
        ZigBee.Device.Panel currentKey;
        /// <summary>
        /// 中部刷新列表
        /// </summary>
        VerticalScrolViewLayout midVerticalScrolViewLayout;
        /// <summary>
        /// 房间列表左右滑动布局
        /// </summary>
        HorizontalScrolViewLayout btnHorizontalScrolViewLayout;
        /// <summary>
        /// 按键配置的目标列表
        /// </summary>
        List<CommonDevice> targetList = new List<CommonDevice>();//本地临时选中列表
        List<CommonDevice> targetList = new List<CommonDevice>();
        /// <summary>
        /// 新的按键配置目标列表中,目标实际存在按键中,此时要删掉的数据
        /// 本地旧的选中列表
        /// </summary>
        List<CommonDevice> oldTargetList = new List<CommonDevice>();//本地旧的选中列表
        int currentClusterID = 6;//当前簇ID
        public Action<List<BindListResponseObj>> action;//回调绑定目标页面刷新
        int currentModeID = 0;//当前模式ID
        string curDeviceBindType = "";//当前设备绑定类型
        List<CommonDevice> oldTargetList = new List<CommonDevice>();
        /// <summary>
        /// 当前簇ID
        /// </summary>
        int currentClusterID = 6;
        /// <summary>
        /// 回调绑定目标页面刷新
        /// </summary>
        public Action<List<BindListResponseObj>> action;
        /// <summary>
        /// 当前模式ID
        /// </summary>
        int currentModeID = 0;
        /// <summary>
        /// 当前设备绑定类型
        /// </summary>
        string curDeviceBindType = "";
        /// <summary>
        /// 类型的具体模式列表
        /// </summary>
        List<int> typeDetailModeList = new List<int> { };
        #endregion
@@ -96,6 +108,7 @@
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                TextSize = 16,
                IsBold = true,
            };
            bottomFrameLayout.AddChidren(btnFinifh);
            #endregion
@@ -231,7 +244,7 @@
                            var dev = new AddedDeviceBindResponseAllData();
                            dev = await currentKey.AddDeviceBindAsync(addBindeDev);
                            if (dev.addedDeviceBindResponseData == null)
                            if (dev != null || dev.addedDeviceBindResponseData == null)
                            {
                                Application.RunOnMainThread(() =>
                                {
@@ -577,6 +590,9 @@
            });
        }
        /// <summary>
        /// 添加开关模式
        /// </summary>
        async private void AddSwitchMode()
        {
            if (typeDetailModeList == null)
@@ -612,13 +628,14 @@
                    Y = Application.GetRealHeight(58),
                    TextColor = Shared.Common.ZigbeeColor.Current.TextBlack,
                    TextAlignment = TextAlignment.CenterLeft,
                    TextSize = 14,
                };
                rowLayout.AddChidren(btnModeText);
                var btnChoose = new Button()
                {
                    Width = Application.GetRealWidth(60),
                    Height = Application.GetRealHeight(60),
                    Width = Application.GetMinReal(60),
                    Height = Application.GetMinReal(60),
                    X = Application.GetRealWidth(861 + 81),
                    Y = Application.GetRealHeight(35),
                    SelectedImagePath = "DoorLock/SelectedIcon.png",
@@ -721,6 +738,9 @@
            }
        }
        /// <summary>
        /// 添加调光模式
        /// </summary>
        async private void AddDimmerMode()
        {
            if (typeDetailModeList == null)
@@ -767,13 +787,14 @@
                    Y = Application.GetRealHeight(58),
                    TextColor = Shared.Common.ZigbeeColor.Current.TextBlack,
                    TextAlignment = TextAlignment.CenterLeft,
                    TextSize = 14,
                };
                rowLayout.AddChidren(btnModeText);
                var btnChoose = new Button()
                {
                    Width = Application.GetRealWidth(60),
                    Height = Application.GetRealHeight(60),
                    Width = Application.GetMinReal(60),
                    Height = Application.GetMinReal(60),
                    X = Application.GetRealWidth(861 + 81),
                    Y = Application.GetRealHeight(35),
                    SelectedImagePath = "DoorLock/SelectedIcon.png",
@@ -810,7 +831,7 @@
                        break;
                }
                if (i == typeDetailModeList.Count - 1)
                if (i == typeDetailModeListTemp.Count - 1)
                {
                    line2.Visible = false;
                }
@@ -902,6 +923,9 @@
            }
        }
        /// <summary>
        /// 添加窗帘模式
        /// </summary>
        async private void AddCurtainMode()
        {
            if (typeDetailModeList == null)
@@ -937,13 +961,14 @@
                    Y = Application.GetRealHeight(58),
                    TextColor = Shared.Common.ZigbeeColor.Current.TextBlack,
                    TextAlignment = TextAlignment.CenterLeft,
                    TextSize = 14,
                };
                rowLayout.AddChidren(btnModeText);
                var btnChoose = new Button()
                {
                    Width = Application.GetRealWidth(60),
                    Height = Application.GetRealHeight(60),
                    Width = Application.GetMinReal(60),
                    Height = Application.GetMinReal(60),
                    X = Application.GetRealWidth(861 + 81),
                    Y = Application.GetRealHeight(35),
                    SelectedImagePath = "DoorLock/SelectedIcon.png",
@@ -1070,23 +1095,6 @@
                btnChoose.MouseUpEventHandler += hander;
                i++;
            }
        }
        private void FinisfhEventHandler(object sender, MouseEventArgs e)
        {
        }
        public void DeviceInfoChange(CommonDevice common, string typeTag)
        {
        }
        public void ChangedILogicStatus(ZigBee.Device.Logic logic)
        {
        }
        public void ChangedISceneStatus(Scene scene)
        {
        }
    }
}