using System; using Shared; using HDL_ON.UI.CSS; using HDL_ON.Entity; namespace HDL_ON.UI { public partial class FanPage : FrameLayout { #region 控件集合 static FanPage bodyView; /// /// 功能名称按钮 /// Button btnFunctionName; /// /// 房间楼层信息按钮 /// Button btnFromFoorAndRoom; /// /// 收藏按钮 /// Button btnCollection; /// /// 图标按钮 /// Button btnSwitchIcon; DiyImageSeekBar barGradualChange; Button btnSwitch; #endregion #region 区域变量 Fan fan; Button btnCollection_Out; Button btnFunctionName_Out; Button btnFromFloor_Out; /// /// 刷新显示信息 /// Action actionRefresh; #endregion public FanPage(Function func) { bodyView = this; fan = func as Fan; } public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut) { bodyView.BackgroundColor = CSS_Color.BackgroundColor; btnCollection_Out = btnCollectionIcon; btnFunctionName_Out = btnFunctionNameOut; btnFromFloor_Out = btnFromFloorOut; FrameLayout controlView = new FrameLayout() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(88), Width = Application.GetRealWidth(327), Height = Application.GetRealHeight(526), BackgroundImagePath = "Public/Fragmentbg.png", }; bodyView.AddChidren(controlView); btnFunctionName = new Button() { X = Application.GetRealWidth(16), Y = Application.GetRealHeight(14), Width = Application.GetRealWidth(270), Height = Application.GetRealHeight(37), TextColor = CSS_Color.FirstLevelTitleColor, TextAlignment = TextAlignment.CenterLeft, TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel, Text = fan.name, }; controlView.AddChidren(btnFunctionName); btnFromFoorAndRoom = new Button() { X = Application.GetRealWidth(16), Y = btnFunctionName.Bottom, Width = Application.GetRealWidth(270), Height = Application.GetRealHeight(21), TextColor = CSS_Color.PromptingColor1, TextAlignment = TextAlignment.CenterLeft, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, Text = fan.GetRoomListName() }; controlView.AddChidren(btnFromFoorAndRoom); btnCollection = new Button() { X = Application.GetRealWidth(273), Y = Application.GetRealHeight(14), Width = Application.GetMinRealAverage(40), Height = Application.GetMinRealAverage(40), SelectedImagePath = "Collection/CollectionIcon.png", UnSelectedImagePath = "Collection/CollectionGrayIcon.png", IsSelected = fan.collection }; controlView.AddChidren(btnCollection); btnSwitchIcon = new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(100), Width = Application.GetRealWidth(198), Height = Application.GetRealWidth(198), IsSelected = fan.trait_on_off.value.ToString() == "on", SelectedImagePath = "FunctionIcon/Electrical/FanIconBg.png", UnSelectedImagePath = "FunctionIcon/Electrical/FanIconBgGray.png", }; controlView.AddChidren(btnSwitchIcon); #region 风速调节 var btnSpeed = new Button() { X = Application.GetRealWidth(56), Y = Application.GetRealHeight(355), Width = Application.GetRealWidth(224), Height = Application.GetRealHeight(21), TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextID = StringId.FanSpeedChange, }; controlView.AddChidren(btnSpeed); barGradualChange = new DiyImageSeekBar() { X = Application.GetRealWidth(56), Y = Application.GetRealHeight(370), Width = Application.GetRealWidth(215), Height = Application.GetRealHeight(54), SeekBarViewHeight = Application.GetRealHeight(8), ThumbImagePath = "Public/ThumbImage.png", ThumbImageHeight = Application.GetRealHeight(54), ProgressBarColor = CSS_Color.MainColor, ProgressTextColor = CSS_Color.FirstLevelTitleColor, ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, ProgressBarUnitSring = "", MinValue = 1, MaxValue = 7, Progress = 0, SeekBarPadding = Application.GetRealWidth(20), }; controlView.AddChidren(barGradualChange); #endregion btnSwitch = new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(462), Width = Application.GetMinRealAverage(40), Height = Application.GetMinRealAverage(40), UnSelectedImagePath = "Public/PowerClose.png", SelectedImagePath = "Public/PowerOpen.png", IsSelected = fan.trait_on_off.value.ToString() == "on" }; controlView.AddChidren(btnSwitch); LoadEventList(); new TopViewDiv(bodyView, Language.StringByID(StringId.Fan)).LoadTopView(fan, actionRefresh); } } }