using System;
|
using ZigBee.Device;
|
namespace Shared.Phone.UserCenter.DoorLock
|
{
|
public class MemberManagement : DoorLockCommonLayout, ZigBee.Common.IStatus
|
{
|
/// <summary>
|
/// 构造函数
|
/// </summary>
|
/// <param name="doorLock"></param>
|
public MemberManagement(ZigBee.Device.DoorLock doorLock)
|
{
|
this.doorLock = doorLock;
|
BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
|
}
|
|
#region ◆ 变量申明__________________________
|
ZigBee.Device.DoorLock doorLock;
|
|
#endregion
|
|
void ReadDoorLockUserInfo()
|
{
|
System.Threading.Tasks.Task.Run(async () =>
|
{
|
try
|
{
|
var list = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockAllAcountUserlist(doorLock);
|
}
|
catch { }
|
finally
|
{
|
}
|
});
|
}
|
|
/// <summary>
|
/// UI显示
|
/// </summary>
|
public void Show()
|
{
|
this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.MemberManagement));
|
|
EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
|
{
|
RemoveFromParent();
|
};
|
this.btnBack.MouseUpEventHandler += eHandlerBack;
|
this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
|
this.MidFrameLayout(this);
|
|
MidFrameLayoutContent();
|
}
|
|
public void MidFrameLayoutContent()
|
{
|
var bodyView = new VerticalRefreshLayout()
|
{
|
};
|
this.midFrameLayout.AddChidren(bodyView);
|
bodyView.BeginHeaderRefreshingAction += () =>
|
{
|
bodyView.BeginHeaderRefreshing();
|
ReadDoorLockUserInfo();
|
bodyView.EndHeaderRefreshing();
|
};
|
for (int i = 0; i < 3; i++)
|
{
|
var RowView = new FrameLayout()
|
{
|
Height = Application.GetRealHeight(150),
|
};
|
bodyView.AddChidren(RowView);
|
|
var btnMemberName = new Button()
|
{
|
X = Application.GetRealWidth(58),
|
Y = Application.GetRealHeight(58),
|
Width = Application.GetRealWidth(743),
|
Height = Application.GetRealHeight(58),
|
TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
|
TextAlignment = TextAlignment.CenterLeft,
|
TextSize = 14,
|
};
|
RowView.AddChidren(btnMemberName);
|
|
var btnRight = new Button()
|
{
|
X = Application.GetRealWidth(58 + 899),
|
Y = Application.GetRealHeight(58),
|
Height = Application.GetRealHeight(58),
|
Width = Application.GetRealWidth(58),
|
UnSelectedImagePath = "Item/RightNext.png",
|
SelectedImagePath = "Item/Down.png",
|
};
|
RowView.AddChidren(btnRight);
|
|
var line2 = new Button()
|
{
|
Y = RowView.Height - 1,
|
X = Application.GetRealWidth(58),
|
Width = Application.GetRealWidth(965),
|
Height = 1,
|
BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
|
};
|
RowView.AddChidren(line2);
|
|
int currentIndex = i;
|
|
EventHandler<MouseEventArgs> eHandler = (sender, e) =>
|
{
|
//var doorLock = new ZigBee.Device.DoorLock();
|
//var memberFrozenPage = new Shared.Phone.UserCenter.DoorLock.MemberFrozenPage(doorLock);
|
//Shared.Phone.UserView.HomePage.Instance.AddChidren(memberFrozenPage);
|
//Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
|
//memberFrozenPage.Show();
|
};
|
btnRight.MouseUpEventHandler += eHandler;
|
RowView.MouseUpEventHandler += eHandler;
|
}
|
}
|
|
#region ◆ 接口实现__________________________
|
/// <summary>
|
/// 处理变化事件 --将弃用 改用DeviceInfoChange()
|
/// </summary>
|
/// <returns>The changed.</returns>
|
/// <param name="common">Common.</param>
|
public void Changed(CommonDevice common)
|
{
|
|
}
|
/// <summary>
|
/// 处理变化事件
|
/// </summary>
|
/// <param name="common"></param>
|
/// <param name="typeTag"></param>
|
public void DeviceInfoChange(CommonDevice common, string typeTag)
|
{
|
}
|
/// <summary>
|
/// Changeds the IL ogic status.
|
/// </summary>
|
/// <param name="logic">Logic.</param>
|
public void ChangedILogicStatus(ZigBee.Device.Logic logic)
|
{
|
}
|
/// <summary>
|
/// Changeds the IS cene status.
|
/// </summary>
|
/// <param name="scene">Scene.</param>
|
public void ChangedISceneStatus(Scene scene)
|
{
|
}
|
#endregion
|
}
|
}
|