黄学彪
2020-12-16 0d9f64668fd7350d6a21fd157e32009a96d98134
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
using System;
using System.Collections.Generic;
using System.Text;
 
namespace Shared.Phone
{
    /// <summary>
    /// 做成一个存在于BodyFrameLayout底部进行单击的按钮✩
    /// </summary>
    public class BottomClickButton : ClickButtonCommon
    {
        /// <summary>
        /// 控件的点击事件
        /// </summary>
        public new Action<Button, MouseEventArgs> ButtonClickEvent = null;
        /// <summary>
        /// 是否检测界面(默认不检测)
        /// </summary>
        public bool CheckForm = false;
        /// <summary>
        /// Y轴坐标
        /// </summary>
        public int Yaxis = 0;
 
        /// <summary>
        /// 做成一个存在于BodyFrameLayout底部进行单击的按钮
        /// </summary>
        /// <param name="i_width">有些界面很特殊,不统一按键宽度,所以预留此参数</param>
        public BottomClickButton(int i_width = 907)
        {
            this.Yaxis = Application.GetRealHeight(1472);
 
            //这个是一般位置
            this.Width = Application.GetRealWidth(i_width);
            this.Height = Application.GetRealHeight(127);
            this.Y = this.Yaxis;
            this.Gravity = Gravity.CenterHorizontal;
            this.Radius = (uint)Application.GetRealHeight(128) / 2;
            this.TextSize = 16;
            this.IsBold = true;
 
            base.ButtonClickEvent += (sender, e) =>
            {
                if (this.CheckForm == true)
                {
                    var form = HdlFormLogic.Current.GetFormByName(this.formName);
                    //检测界面
                    if (form != null && form.CheckForm() == false)
                    {
                        //检测不通过
                        return;
                    }
                }
                this.ButtonClickEvent?.Invoke(sender, e);
            };
        }
    }
}