HDL Home App 第二版本 旧平台金堂用 正在使用
gxc
2019-11-26 2294816f28804660a441038b5cc89921703f4f41
ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs
@@ -33,7 +33,17 @@
        /// <summary>
        /// IconPathType
        /// </summary>
        public int IconPathType = 0;
        public int IconPathType;
        /// <summary>
        /// OldBackgroundImagePath
        /// </summary>
        private string OldBackgroundImagePath;
        /// <summary>
        /// OldIconPathType
        /// </summary>
        public int OldIconPathType;
        #endregion
@@ -49,6 +59,11 @@
        {
            room = r;
            IconPathType = r.BackgroundImageType;
            OldIconPathType= r.BackgroundImageType;
            if (IconPathType != 1)
            {
                OldBackgroundImagePath = r.BackgroundImage;
            }
            AddTop();
            AddBodyView();
@@ -60,6 +75,7 @@
            HdlDeviceAttributeLogic.Current.RemoveEvent("TemperatrueDevice");
            HdlDeviceAttributeLogic.Current.RemoveEvent("HumidityDevice");
            CommonPage.Instance.IsDrawerLockMode = false;
            base.RemoveFromParent();
        }
@@ -383,6 +399,10 @@
                var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
                var fileName = $"Room_{tradeTime}";
                room.Name = nameRow.NameText.Text.Trim();
                if (OldIconPathType != 1)
                {
                    Shared.IO.FileUtils.DeleteFile(OldBackgroundImagePath);
                }
                if (IconPathType == 0)
                {
                    room.BackgroundImage = backGround.UnSelectedImagePath;
@@ -394,6 +414,7 @@
                }
                room.BackgroundImageType = IconPathType;
                room.Save();
                action?.Invoke();
                RemoveFromParent();
            };
@@ -523,7 +544,7 @@
            {
                selectFL.RemoveFromParent();
                var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
                var fileName = $"Room_{tradeTime}";
                var fileName = $"RoomIcon_{tradeTime}.png";
                //从相册选择图片裁剪
                CropImage.SelectPicture((imagePath) =>
                {