wxr
2020-03-05 0bdc0a135dbe31761b53f432ed34f347f0a4e36b
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
using System;
using UIKit;
using CoreGraphics;
 
namespace Shared
{
    /// <summary>
    /// 弹窗
    /// </summary>
    public class Dialog
    {
        Button tempButton;
        FrameLayout mainFrameLayout;
        /// <summary>
        /// 弹窗构造函数
        /// </summary>
        public Dialog()
        {
            Application.MainPage.AddChidren(tempButton = new Button { Visible = false, Width = LayoutParams.MatchParent, Height = LayoutParams.MatchParent, BackgroundColor = 0x88323232 });
            Application.MainPage.AddChidren(mainFrameLayout = new FrameLayout { Visible = false, });
            //mainFrameLayout.MouseUpEventHandler += (sender, e) => { 
            //};
        }
        /// <summary>
        /// 背景颜色
        /// </summary>
        /// <value>The color of the background.</value>
        public uint BackgroundColor
        {
            get
            {
                return mainFrameLayout.BackgroundColor;
            }
            set
            {
                mainFrameLayout.BackgroundColor = value;
            }
        }
 
        /// <summary>
        /// 圆角大小
        /// </summary>
        /// <value>The corner.</value>
        public uint Radius
        {
            get
            {
                return mainFrameLayout.Radius;
            }
            set
            {
                mainFrameLayout.Radius = value;
            }
        }
 
        /// <summary>
        /// 边框线大小
        /// </summary>
        /// <value>The width of the border.</value>
        public uint BorderWidth
        {
            get
            {
                return mainFrameLayout.BorderWidth;
            }
            set
            {
                mainFrameLayout.BorderWidth = value;
            }
        }
 
        /// <summary>
        /// 增加子控件
        /// </summary>
        /// <param name="view">View.</param>
        public void AddChidren(View view)
        {
            mainFrameLayout.AddChidren(view);
        }
 
        /// <summary>
        /// 背景图片路径
        /// </summary>
        /// <value>The background image path.</value>
        public string BackgroundImagePath
        {
            get
            {
                return mainFrameLayout.BackgroundImagePath;
            }
            set
            {
                mainFrameLayout.BackgroundImagePath = value;
            }
        }
 
        /// <summary>
        /// 宽度
        /// </summary>
        /// <value>The width.</value>
        public int Width
        {
            get
            {
                return mainFrameLayout.Width;
            }
            set
            {
                mainFrameLayout.Width = value;
            }
        }
 
        /// <summary>
        /// 高宽
        /// </summary>
        /// <value>The height.</value>
        public int Height
        {
            get
            {
                return mainFrameLayout.Height;
            }
            set
            {
                mainFrameLayout.Height = value;
            }
        }
 
        /// <summary>
        /// X
        /// </summary>
        /// <value>The height.</value>
        public int X
        {
            get
            {
                return mainFrameLayout.X;
            }
            set
            {
                mainFrameLayout.X = value;
            }
        }
 
        /// <summary>
        /// Y
        /// </summary>
        /// <value>The height.</value>
        public int Y
        {
            get
            {
                return mainFrameLayout.Y;
            }
            set
            {
                mainFrameLayout.Y = value;
            }
        }
 
        /// <summary>
        /// 显示当前的界面
        /// </summary>
        public void Show()
        {
            tempButton.Visible = true;
            mainFrameLayout.Visible = true;
            mainFrameLayout.Gravity = Gravity.Center;
            tempButton.BringToFront();
            mainFrameLayout.BringToFront();
        }
 
        /// <summary>
        /// 关闭当前的界面,释放资源
        /// </summary>
        public void Close()
        {
            tempButton.RemoveFromParent();
            mainFrameLayout.RemoveFromParent();
        }
    }
}