コード例 #1
0
        void _clickCounter_OnCountedClick(CountedClickEventArgs e)
        {
            DelFunc func = OnClick;

            clickArg = e;


            Dispatcher.Invoke(DispatcherPriority.Normal, new Action(func));
        }
コード例 #2
0
        protected void MouseBtnClicked(object sender, CountedClickEventArgs e)
        {
            //CountedClickEventArgs e = _clickCounter.Args;// BtnArgs;
            DependencyObject obj = e.MouseBtnArgs.OriginalSource as DependencyObject;

            if (obj.DependencyObjectType.IsSubclassOf(DependencyObjectType.FromSystemType(typeof(UIElement))))
            {
                //    if (obj.DependencyObjectType.IsSubclassOf(DependencyObjectType.FromSystemType(typeof(Shape)))) { return; }
            }
            else
            {
                return;
            }


            MouseButtonEventArgs mbe = e.MouseBtnArgs as MouseButtonEventArgs;
            ListBox view             = (e.Sender as ListBox);
            ListRow row = view.SelectedItem as ListRow;
            ListRowClickEventArgs arg = new ListRowClickEventArgs();

            try
            {
                arg.ListObj     = view;
                arg.ListRowItem = view.SelectedItem as ListRow;
                arg.rowIndex    = Rows.IndexOf(arg.ListRowItem);
                arg.colIndex    = (arg.ListRowItem == null) ? -1 : (arg.ListRowItem.IndexOf(e.MouseBtnArgs.OriginalSource as UIElement));
                if (arg.rowIndex < 0 || arg.colIndex < 0)
                {
                    if (ListRow.ActivatedRow != null)
                    {
                        ListRow.DeActivate();
                    }
                    return;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            if (row == null)
            {
                return;
            }

            //try
            {
                if (e.Count == 1)
                {
                    if (ActionOnClicked == Actions.CheckBoxChecked)
                    {
                        rowCheckboxClicked(row);
                    }
                    else if (ActionOnClicked == Actions.Modify)
                    {
                        if (_editables[arg.colIndex])
                        {
                            row.setModifyMode(arg.colIndex);
                        }
                    }

                    if (E_ListRowClicked != null)
                    {
                        E_ListRowClicked(e.Sender, arg);
                    }
                }
                else if (e.Count == 2)
                {
                    if (ActionOnDoubleClicked == Actions.CheckBoxChecked)
                    {
                        rowCheckboxClicked(row);
                    }
                    else if (ActionOnDoubleClicked == Actions.Modify)
                    {
                        if (_editables[arg.colIndex])
                        {
                            row.setModifyMode(arg.colIndex);
                        }
                    }

                    if (E_ListRowDoubleClicked != null)
                    {
                        E_ListRowDoubleClicked(e.Sender, arg);
                    }
                }
            }
            //catch (Exception ex)
            {
                //    throw ex;
            }
            BeforeClickedRow = row.Index;
        }
コード例 #3
0
 void _clickCounter_OnCountedClick(CountedClickEventArgs e)
 {
     MouseBtnClicked(this, e);
     //if (e.Count == 1) if (E_ListRowClicked != null) E_ListRowClicked(this, new ListRowClickEventArgs());
 }