using System;
|
namespace Shared.Phone.UserCenter.DoorLock
|
{
|
public class DoorLockUserMangement : DoorLockCommonLayout
|
{
|
|
/// 构造函数
|
/// </summary>
|
/// <param name="doorLock"></param>
|
public DoorLockUserMangement(ZigBee.Device.DoorLock doorLock)
|
{
|
this.doorLock = doorLock;
|
BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
|
}
|
|
#region ◆ 变量申明__________________________
|
ZigBee.Device.DoorLock doorLock;
|
#endregion
|
|
/// <summary>
|
/// UI显示
|
/// </summary>
|
public void Show()
|
{
|
this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.UserManagement));
|
|
EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
|
{
|
RemoveFromParent();
|
};
|
this.btnBack.MouseUpEventHandler += eHandlerBack;
|
this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
|
this.MidFrameLayout(this);
|
|
MidFrameLayoutContent();
|
}
|
public void MidFrameLayoutContent()
|
{
|
var bodyView = new VerticalScrolViewLayout()
|
{
|
};
|
this.midFrameLayout.AddChidren(bodyView);
|
|
for (int i = 0; i < 3; i++)
|
{
|
var RowView = new FrameLayout()
|
{
|
Height = Application.GetRealHeight(110),
|
};
|
bodyView.AddChidren(RowView);
|
|
var btnIcon = new Button()
|
{
|
Width = Application.GetRealHeight(13),
|
Height = Application.GetRealHeight(13),
|
X = Application.GetRealWidth(40),
|
UnSelectedImagePath = "Item/Point.png",
|
SelectedImagePath = "Item/PointSelected.png",
|
Gravity = Gravity.CenterVertical,
|
};
|
RowView.AddChidren(btnIcon);
|
|
var UnEditedItem = new Button()
|
{
|
X = btnIcon.Right + Application.GetRealWidth(20),
|
Width = Application.GetRealWidth(300),
|
Height = Application.GetRealHeight(110),
|
TextAlignment = TextAlignment.CenterLeft,
|
};
|
RowView.AddChidren(UnEditedItem);
|
if (i == 0)
|
{
|
UnEditedItem.TextID = R.MyInternationalizationString.UneditFingerprint;
|
}
|
else if (i == 1)
|
{
|
UnEditedItem.TextID = R.MyInternationalizationString.PasswordList;
|
}
|
else if (i == 2)
|
{
|
UnEditedItem.TextID = R.MyInternationalizationString.ProximityCard;
|
}
|
|
var btnRight = new Button()
|
{
|
Width = Application.GetRealWidth(28),
|
Height = Application.GetRealHeight(40),
|
X = UnEditedItem.Right + Application.GetRealWidth(200),
|
UnSelectedImagePath = "Item/Right.png",
|
SelectedImagePath = "Item/RightSelected.png",
|
Gravity = Gravity.CenterVertical,
|
};
|
RowView.AddChidren(btnRight);
|
|
var line2 = new Button()
|
{
|
Y = RowView.Height - 1,
|
Height = 1,
|
BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
|
};
|
RowView.AddChidren(line2);
|
|
int currentIndex = i;
|
|
EventHandler<MouseEventArgs> eHandler = (sender, e) =>
|
{
|
if (currentIndex == 0)
|
{
|
//new FingerPrint(tempDoorLock).Show();
|
}
|
else if (currentIndex == 1)
|
{
|
//PasswordList passwordListView = new PasswordList(tempDoorLock);
|
//UserMiddle.DevicePageView.AddChidren(passwordListView);
|
//passwordListView.ShowUserPasswordPrint();
|
//UserMiddle.DevicePageView.PageIndex = UserMiddle.DevicePageView.ChildrenCount - 1;
|
}
|
else if (currentIndex == 2)
|
{
|
//new ProximityCard(tempDoorLock).Show();
|
}
|
};
|
btnRight.MouseUpEventHandler += eHandler;
|
btnIcon.MouseUpEventHandler += eHandler;
|
RowView.MouseUpEventHandler += eHandler;
|
UnEditedItem.MouseUpEventHandler += eHandler;
|
}
|
}
|
}
|
}
|