| | |
| | | |
| | | 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;
|
| | |
| | | /// <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;
|
| | |
| | | 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;
|
| | |
| | | //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 |