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);
|
};
|
|
|
}
|
}
|
}
|