黄学彪
2019-11-25 160785587667cc0d927f85e44c139ec9dde13a9e
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameLayoutControl.cs
@@ -91,6 +91,13 @@
                this.BindChidrenEvent(view, chidrenBindMode);
            }
            else if (view is ImageView)
            {
                view.MouseUpEventHandler -= ChildrenUpEvent;
                view.MouseDownEventHandler -= ChildrenDownEvent;
                this.BindChidrenEvent(view, chidrenBindMode);
            }
            else if (view is ViewGroup)
            {
                ViewGroup groupContr = (ViewGroup)view;
@@ -124,7 +131,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 +145,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 +202,6 @@
            //绑定子控件事件
            this.BindChidrenEvent(view, chidrenBindMode);
        }
        #endregion
@@ -215,8 +234,19 @@
                //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