using Shared.SimpleControl.Phone; using System; /* 移除后台远程连接,讲远程连接移动到用户节目侧边栏 2017-02-10 */ namespace Shared.SimpleControl.Pad { /// /// 显示功能的导航栏 /// public static class SystemMiddleTop { /// /// 当前主视图 /// public static readonly FrameLayout SystemTopMeunView = new FrameLayout () { Height = Application.GetRealHeight (130), }; static readonly Button TopBottomLine = new Button () { Y = Application.GetRealHeight(122), Width = Application.GetRealWidth (685), Height = Application.GetRealHeight(8), BackgroundColor = SkinStyle.Current.SelectedColor, }; /// /// 网关功能 /// public static readonly Button gateWay = new Button { Width = Application.GetRealWidth (680), Height = LayoutParams.MatchParent, SelectedBackgroundColor = 0xFF333333, BackgroundColor = 0xFF2f2f2f, TextSize = 18, TextID = R.MyInternationalizationString.GateWay, TextAlignment = TextAlignment.Center, IsSelected = true, }; /// /// 设备功能 /// static readonly Button equipmentButton = new Button { Width = Application.GetRealWidth (680), Height = LayoutParams.MatchParent, SelectedBackgroundColor = 0xFF333333, BackgroundColor = 0xFF2f2f2f, TextID = R.MyInternationalizationString.Equipment, TextSize = 18, TextAlignment = TextAlignment.Center, }; /// /// 房间功能 /// static readonly Button roomButton = new Button { Width = Application.GetRealWidth (680), Height = LayoutParams.MatchParent, SelectedBackgroundColor = 0xFF333333, BackgroundColor = 0xFF2f2f2f, TextSize = 18, TextID = R.MyInternationalizationString.Room, TextAlignment = TextAlignment.Center, }; /// /// 初始当前视图 /// public static void Init () { if (null != SystemTopMeunView.Parent) { return; } SystemTopMeunView.Y = SystemTop.FrameLayoutMain.Bottom; SystemHomePage.FrameLayoutMain.AddChidren (SystemTopMeunView); initTopFrameLaout (); } /// /// 当前选择的按键标记为选中状态 /// /// Button. public static void selected (Button button) { gateWay.IsSelected = false; equipmentButton.IsSelected = false; roomButton.IsSelected = false; button.IsSelected = true; TopBottomLine.X = button.X - Application.GetRealWidth(5); } /// /// 初始化上面的控件 /// static void initTopFrameLaout () { gateWay.MouseUpEventHandler += (sender, e) => { selected (gateWay); SystemMiddle.ShowGateWayFrameLayout (); }; gateWay.X = 0; SystemTopMeunView.AddChidren (gateWay); Button btnNull = new Button () { X = gateWay.Right, Width = Application.GetRealWidth(5), BackgroundColor = 0xFF333333, }; SystemTopMeunView.AddChidren (btnNull); equipmentButton.MouseUpEventHandler += (sender, e) => { selected (equipmentButton); CommonPage.FindGatewayChilrenIPAddress = "255.255.255.255"; SystemMiddle.ShowEquipmentBase (); }; equipmentButton.X = btnNull.Right; SystemTopMeunView.AddChidren (equipmentButton); Button btnNull2 = new Button () { X = equipmentButton.Right, Width = Application.GetRealWidth(5), BackgroundColor = 0xFF333333, }; SystemTopMeunView.AddChidren (btnNull2); roomButton.MouseUpEventHandler += (sender, e) => { selected (roomButton); new SystemRoom().ShowRoomList (); }; roomButton.X = btnNull2.Right; SystemTopMeunView.AddChidren (roomButton); SystemTopMeunView.AddChidren (TopBottomLine); } } }