using System; using Shared.Common; namespace Shared.Phone.Device.Category { public class CategorySceneSelectImgByLocal:FrameLayout { public Action action; public CategorySceneSelectImgByLocal() { BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; } public void Show() { #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(CommonPage.AppRealWidth - 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); for (int i = 0; i < 17; i++) { var RoomRowView = new FrameLayout() { Y=midFl.Bottom, Height = Application.GetRealHeight(430), BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor }; midFl.AddChidren(RoomRowView); var backGroundBtn = new Button() { Y = Application.GetRealHeight(30), Width = Application.GetMinRealAverage(CommonPage.AppRealWidth - CommonPage.XLeft * 2), Height = Application.GetMinRealAverage(400), Gravity=Gravity.CenterHorizontal, UnSelectedImagePath = "Scene/Scene" + i.ToString() + ".png", Radius = CommonPage.BigFormRadius }; RoomRowView.AddChidren(backGroundBtn); backGroundBtn.MouseUpEventHandler += (sender, e) => { CategoryAddScene.ImagePath = backGroundBtn.UnSelectedImagePath; Room.AddRoomScene.ImagePath = backGroundBtn.UnSelectedImagePath; action?.Invoke(); this.RemoveFromParent(); }; } #endregion } } }