wjc
2023-08-14 a4e9d02ce5cfc501ef9fecac0047c332b5426df2
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
@@ -1,5 +1,6 @@
using System;
using HDL_ON.UI.Music;
using HDL_ON.UI.UI2.FuntionControlView.Aks.Entity;
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
{
@@ -26,6 +27,7 @@
            Width = Application.GetRealWidth(24),
            Height = Application.GetRealHeight(20),
            UnSelectedImagePath = "AksIcon/shang.png",
            Name= "上",
        };
        Button btnBottom = new Button
        {
@@ -34,6 +36,7 @@
            Width = Application.GetRealWidth(24),
            Height = Application.GetRealHeight(20),
            UnSelectedImagePath = "AksIcon/xia.png",
            Name = "下",
        };
        Button btnLeft = new Button
        {
@@ -42,6 +45,7 @@
            Width = Application.GetRealWidth(20),
            Height = Application.GetRealHeight(24),
            UnSelectedImagePath = "AksIcon/zuo.png",
            Name = "左",
        };
        Button btnRight = new Button
@@ -51,6 +55,7 @@
            Width = Application.GetRealWidth(20),
            Height = Application.GetRealHeight(24),
            UnSelectedImagePath = "AksIcon/you.png",
            Name = "右",
        };
@@ -73,6 +78,7 @@
            Height = Application.GetMinRealAverage(28),
            Radius = (uint)Application.GetRealHeight(14),
            BackgroundColor = MusicColor.SelectedColor,
            Name= "确定"
        };
        public void AddView(FrameLayout layout)
@@ -91,13 +97,16 @@
        /// 上
        /// </summary>
        /// <param name="action"></param>
        public void SetTopClickListener(Action<Button> action)
        public void SetTopClickListener(Action<KeypadEntity> action)
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                //btnTop.BackgroundColor = this.UpBackgroundColor;
                btnTop.IsSelected = false;
                action?.Invoke(btnTop);
                KeypadEntity keypadEntity = new KeypadEntity();
                keypadEntity.name = btnTop.Name;
                keypadEntity.keypad = "key_up";
                action?.Invoke(keypadEntity);
                //弹起来还原背景颜色
            };
            btnTop.MouseUpEventHandler += UpClick;
@@ -115,13 +124,16 @@
        /// 下
        /// </summary>
        /// <param name="action"></param>
        public void SetBottomClickListener(Action<Button> action)
        public void SetBottomClickListener(Action<KeypadEntity> action)
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                //btnBottom.BackgroundColor = this.UpBackgroundColor;
                btnBottom.IsSelected = false;
                action?.Invoke(btnBottom);
                KeypadEntity keypadEntity = new KeypadEntity();
                keypadEntity.name = btnBottom.Name;
                keypadEntity.keypad = "key_down";
                action?.Invoke(keypadEntity);
                //弹起来还原背景颜色
            };
            btnBottom.MouseUpEventHandler += UpClick;
@@ -138,13 +150,16 @@
        /// 左
        /// </summary>
        /// <param name="action"></param>
        public void SetLeftClickListener(Action<Button> action)
        public void SetLeftClickListener(Action<KeypadEntity> action)
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                //btnLeft.BackgroundColor = this.UpBackgroundColor;
                btnLeft.IsSelected = false;
                action?.Invoke(btnLeft);
                KeypadEntity keypadEntity = new KeypadEntity();
                keypadEntity.name = btnLeft.Name;
                keypadEntity.keypad = "key_left";
                action?.Invoke(keypadEntity);
                //弹起来还原背景颜色
            };
            btnLeft.MouseUpEventHandler += UpClick;
@@ -161,13 +176,16 @@
        /// 右
        /// </summary>
        /// <param name="action"></param>
        public void SetRightClickListener(Action<Button> action)
        public void SetRightClickListener(Action<KeypadEntity> action)
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                //btnRight.BackgroundColor = this.UpBackgroundColor;
                btnRight.IsSelected = false;
                action?.Invoke(btnRight);
                KeypadEntity keypadEntity = new KeypadEntity();
                keypadEntity.name = btnRight.Name;
                keypadEntity.keypad = "key_right";
                action?.Invoke(keypadEntity);
                //弹起来还原背景颜色
            };
            btnRight.MouseUpEventHandler += UpClick;
@@ -187,12 +205,15 @@
        /// ok
        /// </summary>
        /// <param name="action"></param>
        public void SetOkClickListener(Action<Button> action)
        public void SetOkClickListener(Action<KeypadEntity> action)
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                btnOk.BackgroundColor = MusicColor.SelectedColor;// this.UpBackgroundColor;
                action?.Invoke(btnOk);
                KeypadEntity keypadEntity = new KeypadEntity();
                keypadEntity.name = btnOk.Name;
                keypadEntity.keypad = "key_ok";
                action?.Invoke(keypadEntity);
                //弹起来还原背景颜色
            };
            btnOk.MouseUpEventHandler += UpClick;