From 66a9965c44ecc32a6696abca876ab9d1cd091584 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期五, 28 二月 2020 15:25:13 +0800 Subject: [PATCH] 2020.2.28 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs | 69 ++++++++++++++++++++++++---------- 1 files changed, 48 insertions(+), 21 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs index a79ddb8..bab9c6a 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; @@ -35,16 +39,12 @@ /// 瀛愭帶浠禮杞村亸绉婚噺(鍏遍�氬畾涔夎�屽凡) /// </summary> public int chidrenYaxis = 0; - /// <summary> - /// 鍦嗚搴�(瀹夊崜鍜孖OS鎴栬闇�瑕侀缂栬瘧) + /// 鍦嗚搴� /// </summary> - public uint RadiusEx + public int RadiusEx { - set - { - this.Radius = value; - } + set { this.Radius = (uint)Application.GetRealHeight(value); } } #endregion @@ -61,14 +61,6 @@ this.MouseUpEventHandler += ChildrenUpEvent; this.MouseDownEventHandler += ChildrenDownEvent; - } - - /// <summary> - /// 鍋氭垚涓�涓櫘閫氱殑FrameLayout鎺т欢 - /// </summary> - /// <param name="flage">娌″暐鐢ㄧ殑涓滆タ</param> - public FrameLayoutControl(bool flage) - { } #endregion @@ -90,6 +82,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) { @@ -124,7 +123,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; @@ -134,7 +137,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; @@ -182,7 +194,6 @@ //缁戝畾瀛愭帶浠朵簨浠� this.BindChidrenEvent(view, chidrenBindMode); - } #endregion @@ -196,7 +207,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; } @@ -210,13 +221,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