| | |
| | | { |
| | | if (btnOption.TextID == StringId.Save) |
| | | { |
| | | if (string.IsNullOrEmpty(room.name)) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 3, |
| | | Text = Language.StringByID(StringId.RoomNameCannotBeEmpty), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(bodyView); |
| | | return; |
| | | } |
| | | foreach (var tempRoom in DB_ResidenceData.residenceData.rooms) |
| | | { |
| | | if (room.name == tempRoom.name) |
| | |
| | | /// </summary> |
| | | void LoadEvent_SkipEditFunctionList() |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | var residentialManagePage = new RoomEditFunctionPage(room.sid); |
| | | MainPage.BasePageView.AddChidren(residentialManagePage); |
| | | residentialManagePage.LoadPage(); |
| | |
| | | pictureOptionView.RemoveFromParent(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => { |
| | | //optionView.Animate = Animate.UpToDown; |
| | | //btnCancel.Animate = Animate.UpToDown; |
| | | //new System.Threading.Thread(() => |
| | | //{ |
| | | //System.Threading.Thread.Sleep(500); |
| | | //Application.RunOnMainThread(() => |
| | | //{ |
| | | pictureOptionView.RemoveFromParent(); |
| | | //}); |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | pictureOptionView.RemoveFromParent(); |
| | | }; |
| | | |
| | | btnTakePicture.MouseUpEventHandler = (sender, e) => { |
| | | btnTakePicture.MouseDownEventHandler = (sender, e) => { |
| | | btnTakePicture.IsSelected = true; |
| | | }; |
| | | btnTakePicture.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnTakePicture.IsSelected = false; |
| | | var pid = Guid.NewGuid(); |
| | | Camera.TakePicture((obj) => { |
| | | if (obj == null) |
| | | return; |
| | | btnRoomBg.UnSelectedImagePath = pid.ToString(); |
| | | },pid.ToString(),false); |
| | | if(pageTitleId == StringId.EditRoomInfo) |
| | | CropImage.TakePicture((imagePath) => |
| | | { |
| | | DB_ResidenceData.residenceData.SaveResidenceData(); |
| | | } |
| | | }; |
| | | |
| | | btnAlbum.MouseUpEventHandler = (sender, e) => { |
| | | var pid = Guid.NewGuid(); |
| | | Camera.SelectPicture((obj) => { |
| | | if (obj == null) |
| | | return; |
| | | btnRoomBg.UnSelectedImagePath = pid.ToString(); |
| | | }, pid.ToString(), false); |
| | | if (imagePath != null) |
| | | { |
| | | btnRoomBg.UnSelectedImagePath = imagePath.ToString(); |
| | | room.backgroundImage = btnRoomBg.UnSelectedImagePath; |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | } |
| | | }, pid.ToString(), 16, 9); |
| | | if (pageTitleId == StringId.EditRoomInfo) |
| | | { |
| | | DB_ResidenceData.residenceData.SaveResidenceData(); |
| | | } |
| | | pictureOptionView.RemoveFromParent(); |
| | | }; |
| | | btnAlbum.MouseDownEventHandler = (sender, e) => { |
| | | btnAlbum.IsSelected = true; |
| | | }; |
| | | |
| | | |
| | | btnAlbum.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnAlbum.IsSelected = false; |
| | | var pid = Guid.NewGuid(); |
| | | CropImage.SelectPicture((imagePath) => |
| | | { |
| | | if (imagePath != null) |
| | | { |
| | | btnRoomBg.UnSelectedImagePath = imagePath.ToString(); |
| | | room.backgroundImage = btnRoomBg.UnSelectedImagePath; |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | #if DEBUG |
| | | new Tip() { CloseTime = 5, Text = imagePath }.Show(MainPage.BasePageView); |
| | | #endif |
| | | } |
| | | }, pid.ToString(), 16, 9); |
| | | if (pageTitleId == StringId.EditRoomInfo) |
| | | { |
| | | DB_ResidenceData.residenceData.SaveResidenceData(); |
| | | } |
| | | pictureOptionView.RemoveFromParent(); |
| | | }; |
| | | } |
| | | } |
| | | } |
| | | } |