| | |
| | | /// <param name="chidrenBindMode">变更的绑定模式</param> |
| | | public void ChangedChidrenBindMode(View view, ChidrenBindMode chidrenBindMode)
|
| | | {
|
| | | if (view is Button) |
| | | if (view is ButtonBase) |
| | | {
|
| | | //子控件移除事件
|
| | | Button button = (Button)view;
|
| | | button.MouseUpEventHandler -= ChildrenUpEvent;
|
| | | ButtonBase button = (ButtonBase)view;
|
| | | button.ButtonClickEvent -= ChildrenUpEvent;
|
| | | button.MouseDownEventHandler -= ChildrenDownEvent; |
| | | |
| | | this.BindChidrenEvent(view, chidrenBindMode); |
| | |
| | | {
|
| | | break;
|
| | | }
|
| | | if (myView is Button)
|
| | | if (myView is ButtonBase)
|
| | | {
|
| | | //子控件移除事件
|
| | | Button button = (Button)myView;
|
| | | button.MouseUpEventHandler -= ChildrenUpEvent;
|
| | | ButtonBase button = (ButtonBase)myView;
|
| | | button.ButtonClickEvent -= ChildrenUpEvent;
|
| | | button.MouseDownEventHandler -= ChildrenDownEvent;
|
| | | }
|
| | | }
|
| | |
| | | /// <param name="chidrenBindMode"></param> |
| | | private void BindChidrenEvent(View view, ChidrenBindMode chidrenBindMode)
|
| | | {
|
| | | if (view is Button && chidrenBindMode != ChidrenBindMode.NotBind) |
| | | if (view is ButtonBase && chidrenBindMode != ChidrenBindMode.NotBind) |
| | | {
|
| | | //为子控件添加事件
|
| | | Button button = (Button)view;
|
| | | button.MouseUpEventHandler -= ChildrenUpEvent;
|
| | | ButtonBase button = (ButtonBase)view;
|
| | | button.ButtonClickEvent -= ChildrenUpEvent;
|
| | | button.MouseDownEventHandler -= ChildrenDownEvent;
|
| | |
|
| | | button.MouseUpEventHandler += ChildrenUpEvent;
|
| | | button.ButtonClickEvent += ChildrenUpEvent;
|
| | | button.MouseDownEventHandler += ChildrenDownEvent; |
| | | }
|
| | | else if (view is ViewGroup && chidrenBindMode != ChidrenBindMode.NotBind)
|
| | |
| | | {
|
| | | break;
|
| | | }
|
| | | if (myView is Button)
|
| | | if (myView is ButtonBase)
|
| | | {
|
| | | //为子控件添加事件
|
| | | Button button = (Button)myView;
|
| | | button.MouseUpEventHandler -= ChildrenUpEvent;
|
| | | ButtonBase button = (ButtonBase)myView;
|
| | | button.ButtonClickEvent -= ChildrenUpEvent;
|
| | | button.MouseDownEventHandler -= ChildrenDownEvent;
|
| | |
|
| | | button.MouseUpEventHandler += ChildrenUpEvent;
|
| | | button.ButtonClickEvent += ChildrenUpEvent;
|
| | | button.MouseDownEventHandler += ChildrenDownEvent;
|
| | | }
|
| | | }
|
| | |
| | | /// <param name="e">E.</param> |
| | | private void ChildrenUpEvent(object sender, MouseEventArgs e) |
| | | {
|
| | | if (sender is FrameLayoutControl)
|
| | | {
|
| | | //LOG出力
|
| | | this.WriteLog();
|
| | | }
|
| | | //调用委托
|
| | | ButtonClickEvent?.Invoke(sender, e); |
| | | }
|
| | |
| | |
|
| | | //设置选择状态
|
| | | this.SetClickSelectStatu();
|
| | | new System.Threading.Thread(() =>
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | System.Threading.Thread.Sleep(waiTime);
|
| | | Application.RunOnMainThread(() =>
|
| | |
| | | //设置不选择状态
|
| | | this.SetClickNotSelectStatu();
|
| | | });
|
| | | })
|
| | | { IsBackground = true }.Start();
|
| | | });
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ Log出力____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 该控件所属的界面名字
|
| | | /// </summary>
|
| | | private string formName = null;
|
| | |
|
| | | /// <summary>
|
| | | /// Log出力
|
| | | /// </summary>
|
| | | private void WriteLog()
|
| | | {
|
| | | if (formName == null)
|
| | | {
|
| | | formName = string.Empty;
|
| | | View myView = this.Parent;
|
| | | for (; ; )
|
| | | {
|
| | | if (myView == null)
|
| | | {
|
| | | break;
|
| | | }
|
| | | else if (myView is CommonFormBase)
|
| | | {
|
| | | formName = ((CommonFormBase)myView).FormID;
|
| | | break;
|
| | | }
|
| | | myView = myView.Parent;
|
| | | }
|
| | | }
|
| | | HdlLogLogic.Current.WriteLog(1, formName + ".FrameLayoutControl 被点击");
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|