using System; using Shared.Common; namespace Shared.Phone.Device.Room { public class AddRoomSelectPicByLocal:FrameLayout { public Action action; public AddRoomSelectPicByLocal() { BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; } public override void RemoveFromParent() { base.RemoveFromParent(); } public void Show() { ShowPic(); } void ShowPic() { #region topview var topBGView = new FrameLayout()
 {
 Height = Application.GetRealHeight(CommonPage.Navigation_Height),
 BackgroundColor = ZigbeeColor.Current.GXCTopViewBackgroundColor
 };
 AddChidren(topBGView);
 var topView = new FrameLayout()
 {
 Y = Application.GetRealHeight(CommonPage.NavigationTitle_Y),
 Height = Application.GetRealHeight(CommonPage.Navigation_Height - CommonPage.NavigationTitle_Y),
 BackgroundColor = ZigbeeColor.Current.GXCTopViewBackgroundColor,
 };
 AddChidren(topView); var title = new Button() { TextAlignment = TextAlignment.Center, //TextID = R.MyInternationalizationString.SelectPic, TextSize = 20, TextColor = ZigbeeColor.Current.GXCTextBlackColor, Width = Application.GetRealWidth(500), Gravity = Gravity.CenterHorizontal }; topView.AddChidren(title); var back = new Device.CommonForm.BackButton() { };
 topView.AddChidren(back); back.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); }; #endregion #region midFL var midFl = new VerticalScrolViewLayout() { Height = Application.GetRealHeight(CommonPage.AppRealHeight - CommonPage.Navigation_Height), Y = topView.Bottom, BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, }; this.AddChidren(midFl); int k = 0; for (int j = 0; j < 3; j++) { var itemView = new FrameLayout() { Height = Application.GetRealHeight(311 + 58) }; midFl.AddChidren(itemView); for (int i = 0; i < 2; i++) { var icon = new ImageView() { X = Application.GetRealWidth(58 + i * (467 + 32)), Y = Application.GetRealHeight(58), Width = Application.GetRealWidth(467), Height = Application.GetRealHeight(311), ImagePath = $"RoomIcon/{k}.JPG", Radius = (uint)Application.GetRealHeight(17) }; itemView.AddChidren(icon); icon.SetViewShadow(true); k++; EventHandler selectIcon = (sender, e) => { action?.Invoke(icon.ImagePath); action = null; this.RemoveFromParent(); }; icon.MouseUpEventHandler += selectIcon; } } #endregion } } }