wxr
2020-03-05 0bdc0a135dbe31761b53f432ed34f347f0a4e36b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
using System;
using Shared;
 
namespace HDL_ON.UI
{
    public partial class RoomEditPage
    {
        /// <summary>
        /// 加载事件列表
        /// </summary>
        void LoadEventList()
        {
            LoadEvent_PictureOptionView();
            LoadEvent_EditRoomName();
            LoadEvent_SkinBindFloor();
        }
 
        /// <summary>
        /// 显示背景图选择选项
        /// </summary>
        void LoadEvent_PictureOptionView()
        {
            btnRoomBg.MouseUpEventHandler = (sender, e) =>
            {
                LoadPictureOptionView();
            };
        }
 
        /// <summary>
        /// 加载修改房间名称窗口事件
        /// </summary>
        void LoadEvent_EditRoomName()
        {
            Action<string> callBack = (str) =>
            {
                btnRoomName.Text = btnTipRoomName.Text = str;
                room.name = str;
            };
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
                new PublicAssmebly().LoadDialog_EditParater(StringId.RoomName, room.name, callBack);
            };
            btnEditRoomNameIcon.MouseUpEventHandler = eventHandler;
            roomNameRow.MouseUpEventHandler = eventHandler;
        }
 
        /// <summary>
        /// 跳转绑定楼层界面
        /// </summary>
        void LoadEvent_SkinBindFloor()
        {
            EventHandler<MouseEventArgs> eventHandler = (sender, e) => {
                var residentialManagePage = new FloorsManagementPage();
                MainPage.BasePageView.AddChidren(residentialManagePage);
                residentialManagePage.LoadPage(room);
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            btnFloorInfo.MouseUpEventHandler = eventHandler;
            floorView.MouseUpEventHandler = eventHandler;
        }
 
 
        /// <summary>
        /// 加载背景图选择区域事件列表
        /// </summary>
        void LoadEvent_PictureOptionViewEventList()
        {
            pictureOptionView.MouseUpEventHandler = (sender, e) =>
            {
                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();
            };
 
            btnTakePicture.MouseUpEventHandler = (sender, e) => {
                var pid = Guid.NewGuid();
                Camera.TakePicture((obj) => {
                    if (obj == null)
                        return;
                    btnRoomBg.UnSelectedImagePath = pid.ToString();
                },pid.ToString(),false);
            };
 
            btnAlbum.MouseUpEventHandler = (sender, e) => {
                var pid = Guid.NewGuid();
                Camera.SelectPicture((obj) => {
                    if (obj == null)
                        return;
                    btnRoomBg.UnSelectedImagePath = pid.ToString();
                }, pid.ToString(), false);
            };
 
 
        }
    }
}