wxr
2020-02-27 37c33341f75841dc39c535eb62a3603f596516a1
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
using System;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
 
namespace HDL_ON.UI
{
    public class PublicAssmebly
    {
        /// <summary>
        /// 向framelayout添加顶部区域
        /// </summary>
        /// <param name="frame"></param>
        /// <param name="tilte"></param>
        public void LoadTopView(FrameLayout frame, string tilte)
        {
            FrameLayout view = new FrameLayout()
            {
                Height = Application.GetRealHeight(64),
                BackgroundColor = CSS_Color.TopViewColor,
            };
            frame.AddChidren(view);
 
            Button btnBack = new Button()
            {
                X = Application.GetRealWidth(10),
                Y = Application.GetRealHeight(29),
                Width = Application.GetRealWidth(40),
                Height = Application.GetRealHeight(28),
                UnSelectedImagePath = "Public/BackIcon.png",
            };
            frame.AddChidren(btnBack);
            btnBack.MouseUpEventHandler += (sender, e) =>
            {
                frame.RemoveFromParent();
            };
 
            Button btnTilte = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(30),
                Width = Application.GetRealWidth(150),
                Height = Application.GetRealHeight(25),
                TextAlignment = TextAlignment.Center,
                TextSize = CSS_FontSize.HeadlineFontSize,
                TextColor = CSS_Color.FirstLevelTitleColor,
                Text = tilte
            };
            frame.AddChidren(btnTilte);
        }
 
        /// <summary>
        /// 向dialog添加顶部区域
        /// </summary>
        /// <param name="dialog"></param>
        /// <param name="frame"></param>
        /// <param name="tilte"></param>
        public void LoadTopView(Dialog dialog, FrameLayout frame, string tilte)
        {
            FrameLayout view = new FrameLayout()
            {
                Height = Application.GetRealHeight(64),
                BackgroundColor = CSS_Color.TopViewColor,
            };
            frame.AddChidren(view);
 
            Button btnBack = new Button()
            {
                X = Application.GetRealWidth(10),
                Y = Application.GetRealHeight(29),
                Width = Application.GetRealWidth(40),
                Height = Application.GetRealHeight(28),
                UnSelectedImagePath = "Public/BackIcon.png",
            };
            frame.AddChidren(btnBack);
            btnBack.MouseUpEventHandler += (sender, e) =>
            {
                dialog.Close();
            };
 
            Button btnTilte = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(30),
                Width = Application.GetRealWidth(150),
                Height = Application.GetRealHeight(25),
                TextAlignment = TextAlignment.Center,
                TextSize = CSS_FontSize.HeadlineFontSize,
                TextColor = CSS_Color.FirstLevelTitleColor,
                Text = tilte
            };
            frame.AddChidren(btnTilte);
        }
 
        /// <summary>
        /// 向framelayout添加顶部区域,拥有功能配置按钮
        /// </summary>
        /// <param name="frame"></param>
        /// <param name="tilte"></param>
        public void LoadTopView(FrameLayout frame, string tilte,Function function)
        {
            FrameLayout view = new FrameLayout()
            {
                Height = Application.GetRealHeight(64),
                BackgroundColor = CSS_Color.TopViewColor,
            };
            frame.AddChidren(view);
 
            Button btnBack = new Button()
            {
                X = Application.GetRealWidth(10),
                Y = Application.GetRealHeight(29),
                Width = Application.GetRealWidth(40),
                Height = Application.GetRealHeight(28),
                UnSelectedImagePath = "Public/BackIcon.png",
            };
            frame.AddChidren(btnBack);
            btnBack.MouseUpEventHandler += (sender, e) =>
            {
                frame.RemoveFromParent();
            };
 
            Button btnTilte = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(30),
                Width = Application.GetRealWidth(150),
                Height = Application.GetRealHeight(25),
                TextAlignment = TextAlignment.Center,
                TextSize = CSS_FontSize.HeadlineFontSize,
                TextColor = CSS_Color.FirstLevelTitleColor,
                Text = tilte
            };
            frame.AddChidren(btnTilte);
 
            var btnSetting = new Button()
            {
                X = Application.GetRealWidth(337),
                Y = Application.GetRealHeight(29),
                Width = Application.GetMinRealAverage(28),
                Height = Application.GetMinRealAverage(28),
                UnSelectedImagePath = "Public/FuncInfoSetIcon.png",
            };
            frame.AddChidren(btnSetting);
 
            btnSetting.MouseUpEventHandler += (sender, e) => {
                var infoView = new FunctionBaseInfoSetPage(function);
                MainPage.BasePageView.AddChidren(infoView);
                infoView.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
        }
 
    }
}