From c1cb2d8c6034a2ee7aa8a5710bba15b14f76cebc Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期五, 18 八月 2023 18:54:31 +0800
Subject: [PATCH] 2023年08月18日18:54:22

---
 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs |   59 +++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 41 insertions(+), 18 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
index 80ea0ac..a969558 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
@@ -1,5 +1,6 @@
 锘縰sing 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,8 @@
             Width = Application.GetRealWidth(24),
             Height = Application.GetRealHeight(20),
             UnSelectedImagePath = "AksIcon/shang.png",
+            SelectedImagePath = "AksIcon/shang_selected.png",
+            Name = "涓�",
         };
         Button btnBottom = new Button
         {
@@ -34,6 +37,8 @@
             Width = Application.GetRealWidth(24),
             Height = Application.GetRealHeight(20),
             UnSelectedImagePath = "AksIcon/xia.png",
+            SelectedImagePath = "AksIcon/xia_selected.png",
+            Name = "涓�",
         };
         Button btnLeft = new Button
         {
@@ -42,6 +47,8 @@
             Width = Application.GetRealWidth(20),
             Height = Application.GetRealHeight(24),
             UnSelectedImagePath = "AksIcon/zuo.png",
+            SelectedImagePath = "AksIcon/zuo_selected.png",
+            Name = "宸�",
 
         };
         Button btnRight = new Button
@@ -51,6 +58,8 @@
             Width = Application.GetRealWidth(20),
             Height = Application.GetRealHeight(24),
             UnSelectedImagePath = "AksIcon/you.png",
+            SelectedImagePath = "AksIcon/you_selected.png",
+            Name = "鍙�",
 
         };
 
@@ -73,6 +82,7 @@
             Height = Application.GetMinRealAverage(28),
             Radius = (uint)Application.GetRealHeight(14),
             BackgroundColor = MusicColor.SelectedColor,
+            Name= "纭畾"
         };
 
         public void AddView(FrameLayout layout)
@@ -91,13 +101,11 @@
         /// 涓�
         /// </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);
                 //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
             };
             btnTop.MouseUpEventHandler += UpClick;
@@ -106,7 +114,11 @@
             EventHandler<MouseEventArgs> DownClick = (sender, e) =>
             {
                 //鎸変笅鍘绘敼鍙樿儗鏅鑹�
-                btnTop.BackgroundColor = this.DownBackgroundColor;
+                btnTop.IsSelected = true;
+                KeypadEntity keypadEntity = new KeypadEntity();
+                keypadEntity.name = btnTop.Name;
+                keypadEntity.keypad = "key_up";
+                action?.Invoke(keypadEntity);
             };
             btnTop.MouseDownEventHandler += DownClick;
         }
@@ -115,13 +127,13 @@
         /// 涓�
         /// </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);
+
+
                 //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
             };
             btnBottom.MouseUpEventHandler += UpClick;
@@ -129,8 +141,12 @@
 
             EventHandler<MouseEventArgs> DownClick = (sender, e) =>
             {
+                btnBottom.IsSelected = true;
+                KeypadEntity keypadEntity = new KeypadEntity();
+                keypadEntity.name = btnBottom.Name;
+                keypadEntity.keypad = "key_down";
+                action?.Invoke(keypadEntity);
                 //鎸変笅鍘绘敼鍙樿儗鏅鑹�
-                btnBottom.BackgroundColor = this.DownBackgroundColor;
             };
             btnBottom.MouseDownEventHandler += DownClick;
         }
@@ -138,13 +154,11 @@
         /// 宸�
         /// </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);
                 //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
             };
             btnLeft.MouseUpEventHandler += UpClick;
@@ -152,8 +166,12 @@
 
             EventHandler<MouseEventArgs> DownClick = (sender, e) =>
             {
+                btnLeft.IsSelected = true;
+                KeypadEntity keypadEntity = new KeypadEntity();
+                keypadEntity.name = btnLeft.Name;
+                keypadEntity.keypad = "key_left";
+                action?.Invoke(keypadEntity);
                 //鎸変笅鍘绘敼鍙樿儗鏅鑹�
-                btnLeft.BackgroundColor = this.DownBackgroundColor;
             };
             btnLeft.MouseDownEventHandler += DownClick;
         }
@@ -161,13 +179,11 @@
         /// 鍙�
         /// </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);
                 //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
             };
             btnRight.MouseUpEventHandler += UpClick;
@@ -176,7 +192,11 @@
             EventHandler<MouseEventArgs> DownClick = (sender, e) =>
             {
                 //鎸変笅鍘绘敼鍙樿儗鏅鑹�
-                btnRight.BackgroundColor = this.DownBackgroundColor;
+                btnRight.IsSelected = true;
+                KeypadEntity keypadEntity = new KeypadEntity();
+                keypadEntity.name = btnRight.Name;
+                keypadEntity.keypad = "key_right";
+                action?.Invoke(keypadEntity);
             };
             btnRight.MouseDownEventHandler += DownClick;
         }
@@ -187,12 +207,11 @@
         /// 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);
                 //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
             };
             btnOk.MouseUpEventHandler += UpClick;
@@ -200,6 +219,10 @@
 
             EventHandler<MouseEventArgs> DownClick = (sender, e) =>
             {
+                KeypadEntity keypadEntity = new KeypadEntity();
+                keypadEntity.name = btnOk.Name;
+                keypadEntity.keypad = "key_ok";
+                action?.Invoke(keypadEntity);
                 //鎸変笅鍘绘敼鍙樿儗鏅鑹�
                 btnOk.BackgroundColor = this.DownBackgroundColor;
             };

--
Gitblit v1.8.0