using System;
|
using Shared;
|
|
namespace HDL_ON.UI
|
{
|
public partial class PersonalDataPage
|
{
|
/// <summary>
|
/// 加载事件列表
|
/// </summary>
|
void LoadEventList()
|
{
|
LoadEvent_ChangeHeadImageView();
|
LoadEvent_Logout();
|
}
|
|
/// <summary>
|
/// 加载选择头像选项view
|
/// </summary>
|
void LoadEvent_ChangeHeadImageView()
|
{
|
userHeadImageView.MouseUpEventHandler = (sender, e) => {
|
LoadPictureOptionView();
|
};
|
}
|
|
/// <summary>
|
/// 退出账号登录事件
|
/// </summary>
|
void LoadEvent_Logout()
|
{
|
btnLogout.MouseUpEventHandler += (sender, e) => {
|
MainPage.LoginUser.lastTime = DateTime.MinValue;
|
MainPage.LoginUser.SaveUserInfo();
|
MainPage.GoLoginPage(MainPage.LoginUser.accountString);
|
};
|
}
|
|
|
/// <summary>
|
/// 加载背景图选择区域事件列表
|
/// </summary>
|
void LoadEvent_PictureOptionViewEventList()
|
{
|
pictureOptionView.MouseUpEventHandler = (sender, e) =>
|
{
|
pictureOptionView.RemoveFromParent();
|
};
|
|
btnCancel.MouseUpEventHandler = (sender, e) =>
|
{
|
pictureOptionView.RemoveFromParent();
|
};
|
|
btnTakePicture.MouseUpEventHandler = (sender, e) =>
|
{
|
var pid = Guid.NewGuid();
|
CropImage.TakePicture((Action<string>)((imagePath) =>
|
{
|
if (imagePath != null)
|
{
|
MainPage.LoginUser.headImagePagePath = imagePath.ToString();
|
userHeadImageView.ImagePath = imagePath.ToString();
|
updataHeadImage();
|
new System.Threading.Thread(() =>
|
{
|
new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath);
|
})
|
{ IsBackground = true }.Start();
|
MainPage.LoginUser.SaveUserInfo();
|
MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath);
|
}
|
}), pid.ToString(), 1, 1);
|
pictureOptionView.RemoveFromParent();
|
};
|
|
btnAlbum.MouseUpEventHandler = (sender, e) =>
|
{
|
var pid = Guid.NewGuid();
|
CropImage.SelectPicture((imagePath) =>
|
{
|
if (imagePath != null)
|
{
|
MainPage.LoginUser.headImagePagePath = imagePath.ToString();
|
userHeadImageView.ImagePath = imagePath.ToString();
|
updataHeadImage();
|
|
new System.Threading.Thread(() =>
|
{
|
new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath);
|
})
|
{ IsBackground = true }.Start(); MainPage.LoginUser.SaveUserInfo();
|
MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath);
|
}
|
}, pid.ToString(), 1, 1);
|
pictureOptionView.RemoveFromParent();
|
};
|
}
|
|
|
}
|
}
|