CrabtreeOn,印度客户定制APP,迁移2.0平台版本
1
wxr
2023-03-31 d53e6af2c5f17838fa79659614b15a2a1f383399
Crabtree/SmartHome/UI/SimpleControl/Phone/Scene/UserScenePage.cs
@@ -135,9 +135,8 @@
                            BackgroundColor = SkinStyle.Current.Black50Transparent,
                        };
                        sceneView.AddChidren (btnSceneName);
                        var btnBGC = new Button () {
                            //UnSelectedImagePath = "Item/sss.png",
                            UnSelectedImagePath = "Item/Transparent.png",
                            SelectedImagePath = "Item/SceneSettingBackground.png",
                            TextAlignment = TextAlignment.BottomCenter,
@@ -147,14 +146,28 @@
                        };
                        sceneView.AddChidren (btnBGC);
                        btnBGC.MouseLongEventHandler += (sender, e) => {
                        var btnSetSceneIcon = new Button () {
                            UnSelectedImagePath = "Item/More2.png",
                            SelectedImagePath = "Item/Transparent.png",
                            Height = Application.GetRealHeight (50),
                            Width = Application.GetRealWidth (60),
                            X = Application.GetRealWidth(240),
                            Y = Application.GetRealHeight(10),
                        };
                        sceneView.AddChidren (btnSetSceneIcon);
                        //btnBGC.MouseLongEventHandler += (sender, e) => {
                        btnSetSceneIcon.MouseUpEventHandler += (sender, e) => {
                            if (string.IsNullOrEmpty (scene.Name))
                                return;
                            btnSetSceneIcon.IsSelected = true;
                            LongPressFrameLayout = new FrameLayout () {
                                BackgroundColor = SkinStyle.Current.SceneTransparentBackColor,
                            };
                            LongPressFrameLayout.MouseUpEventHandler += (sender2, e2) => {
                                LongPressFrameLayout.RemoveFromParent ();
                                btnSetSceneIcon.IsSelected = false;
                            };
                            sceneView.AddChidren (LongPressFrameLayout);
@@ -190,12 +203,20 @@
                            LongPressFrameLayout.AddChidren (btnDel);
                            btnDel.MouseUpEventHandler += (senderDel, eDel) => {
                                IO.FileUtils.DeleteFile (sceneFilePath);
                                room.SceneFilePathList.Remove (sceneFilePath);
                                room.SceneFilePathList.Remove ("");
                                room.Save (room.RoomFilePath);
                                ShowUserScene (Room.GetRoomByFilePath (room.RoomFilePath));
                                UserDeviceToScene.hasModify = true;
                                Alert alert = new Alert ("", $"Are you sure to delete the scenario: {scene.Name}?", Language.StringByID (R.MyInternationalizationString.Cancel), Language.StringByID (R.MyInternationalizationString.Confrim));
                                alert.ResultEventHandler += (sender2, e2) => {
                                    if (e2) {
                                        IO.FileUtils.DeleteFile (sceneFilePath);
                                        room.SceneFilePathList.Remove (sceneFilePath);
                                        room.SceneFilePathList.Remove ("");
                                        room.Save (room.RoomFilePath);
                                        ShowUserScene (Room.GetRoomByFilePath (room.RoomFilePath));
                                        UserDeviceToScene.hasModify = true;
                                    }
                                };
                                alert.Show ();
                                
                                //if (CommonList.MonitorScenePathList.Count > 0) {
                                //    foreach (var monitorData in CommonList.MonitorScenePathList) {