From f1c3921b08bb22ac6f5db22d620e01d7e8e5c49f Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期一, 30 十二月 2019 13:32:33 +0800 Subject: [PATCH] 2019-12-30-1 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs | 53 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 46 insertions(+), 7 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs index 8dba4e5..e4f7202 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs @@ -24,6 +24,10 @@ /// </summary> public bool UseClickStatu = true; /// <summary> + /// 鑳藉惁鐐瑰嚮 + /// </summary> + public bool CanClick = true; + /// <summary> /// 鍘熸潵鐨勮儗鏅壊 /// </summary> private uint oldBackColor = 0; @@ -50,7 +54,7 @@ this.MouseUpEventHandler += ChildrenUpEvent; this.MouseDownEventHandler += ChildrenDownEvent; - } + } #endregion @@ -71,6 +75,13 @@ button.MouseDownEventHandler -= ChildrenDownEvent; this.BindChidrenEvent(view, chidrenBindMode); + } + else if (view is ImageView) + { + view.MouseUpEventHandler -= ChildrenUpEvent; + view.MouseDownEventHandler -= ChildrenDownEvent; + + this.BindChidrenEvent(view, chidrenBindMode); } else if (view is ViewGroup) { @@ -105,7 +116,11 @@ /// <param name="chidrenBindMode"></param> private void BindChidrenEvent(View view, ChidrenBindMode chidrenBindMode) { - if (view is ButtonBase && chidrenBindMode != ChidrenBindMode.NotBind) + if (chidrenBindMode == ChidrenBindMode.NotBind) + { + return; + } + if (view is ButtonBase) { //涓哄瓙鎺т欢娣诲姞浜嬩欢 ButtonBase button = (ButtonBase)view; @@ -115,7 +130,16 @@ button.ButtonClickEvent += ChildrenUpEvent; button.MouseDownEventHandler += ChildrenDownEvent; } - else if (view is ViewGroup && chidrenBindMode != ChidrenBindMode.NotBind) + else if (view is ImageView) + { + //鑷韩涔熸坊鍔犱簨浠� + view.MouseUpEventHandler -= ChildrenUpEvent; + view.MouseDownEventHandler -= ChildrenDownEvent; + + view.MouseUpEventHandler += ChildrenUpEvent; + view.MouseDownEventHandler += ChildrenDownEvent; + } + else if (view is ViewGroup) { //涓哄瓙鎺т欢娣诲姞浜嬩欢 ViewGroup groupContr = (ViewGroup)view; @@ -163,7 +187,6 @@ //缁戝畾瀛愭帶浠朵簨浠� this.BindChidrenEvent(view, chidrenBindMode); - } #endregion @@ -177,7 +200,7 @@ /// <param name="e">E.</param> private void ChildrenDownEvent(object sender, MouseEventArgs e) { - if (this.UseClickStatu == false) + if (this.UseClickStatu == false|| this.CanClick == false) { return; } @@ -191,13 +214,29 @@ /// <param name="e">E.</param> private void ChildrenUpEvent(object sender, MouseEventArgs e) { + if (this.CanClick == false) + { + //涓嶅厑璁哥偣鍑� + return; + } if (sender is FrameLayoutControl) { //LOG鍑哄姏 this.WriteLog(); } - //璋冪敤濮旀墭 - ButtonClickEvent?.Invoke(sender, e); + try + { + //璋冪敤濮旀墭 + ButtonClickEvent?.Invoke(sender, e); + } + catch (Exception ex) + { + //鍑虹幇鏈煡閿欒 + var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError)); + alert.Show(); + //Log鍑哄姏 + HdlLogLogic.Current.WriteLog(ex); + } } #endregion -- Gitblit v1.8.0