wxr
2021-06-06 dc8967247d149e9b0d1f8e75829928db0ea1fe13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using System;
using Shared;
namespace HDL_ON.UI.UI2.Intelligence.Automation
{
    public class Weather : FrameLayout
    {
        public Weather()
        {
            Tag = "Logic";
        }
 
        public void Show()
        {
            #region  界面布局
            LogicView.TopView topView = new LogicView.TopView();
            this.AddChidren(topView.FLayoutView());
            topView.clickBackBtn.MouseUpEventHandler += (e, sen) =>
            {
                RemoveFromParent();
            };
            topView.topNameBtn.TextID = StringId.xuanzeshiwaibianhuatiaojian;
 
            FrameLayout viewLayout = new FrameLayout
            {
                Y = Application.GetRealHeight(64),
                Width = Application.GetRealWidth(LogicView.TextSize.view375),
                Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64),
                BackgroundColor = CSS.CSS_Color.viewMiddle,
            };
            this.AddChidren(viewLayout);
            //室外温、湿度、PM2.5变化
            LogicView.SelectTypeView airqualityView = new LogicView.SelectTypeView();
            airqualityView.btnIcon.Visible = false;
            airqualityView.btnText.X = Application.GetRealWidth(16);
            airqualityView.btnLine.X = Application.GetRealWidth(16);
            airqualityView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16);
            airqualityView.btnText.TextID =StringId.shuwaigongneng;
            viewLayout.AddChidren(airqualityView.FLayoutView());
            //天气变化(城市天气)
            LogicView.SelectTypeView weatherView = new LogicView.SelectTypeView();
            weatherView.frameLayout.Y = airqualityView.frameLayout.Bottom;
            weatherView.btnIcon.Visible = false;
            weatherView.btnText.X = Application.GetRealWidth(16);
            weatherView.btnLine.X = Application.GetRealWidth(16);
            weatherView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16);
            weatherView.btnText.TextID = StringId.tianqibianhua;
            viewLayout.AddChidren(weatherView.FLayoutView());
            //空气质量
            LogicView.SelectTypeView kongqiViewk = new LogicView.SelectTypeView(); 
            kongqiViewk.frameLayout.Y = weatherView.frameLayout.Bottom;
            kongqiViewk.btnIcon.Visible = false;
            kongqiViewk.btnText.X = Application.GetRealWidth(16);
            kongqiViewk.btnLine.X = Application.GetRealWidth(16);
            kongqiViewk.btnLine.Width = Application.GetRealWidth(375 - 16 - 16);
            kongqiViewk.btnText.TextID = StringId.kongqizhiliang;
            viewLayout.AddChidren(kongqiViewk.FLayoutView());
            #endregion
            #region  所有点击事件
            //室外温、湿度、PM2.5变化
            airqualityView.btnClick.MouseUpEventHandler += (sen, e) => {
                OutdoorEnvironment outdoorEnvironment = new OutdoorEnvironment();
                MainPage.BasePageView.AddChidren(outdoorEnvironment);
                outdoorEnvironment.Show();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
 
            };
            //天气变化(城市天气)
            weatherView.btnClick.MouseUpEventHandler += (sen, e) => {
                WeatherCondition weatherCondition = new WeatherCondition();
                MainPage.BasePageView.AddChidren(weatherCondition);
                weatherCondition.Show();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            //空气质量
            kongqiViewk.btnClick.MouseUpEventHandler += (sen, e) => {
                AirQuality airQuality = new AirQuality();
                MainPage.BasePageView.AddChidren(airQuality);
                airQuality.Show();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
 
            #endregion
        }
    }
}