コード例 #1
0
        internal void RaiseAutomationInvokeEvents(DataGridEditingUnit editingUnit, DataGridColumn column, DataGridRow row)
        {
            switch (editingUnit)
            {
            case DataGridEditingUnit.Cell:
            {
                DataGridCell   cell = row.Cells[column.Index];
                AutomationPeer peer = FromElement(cell);
                if (peer != null)
                {
                    peer.InvalidatePeer();
                }
                else
                {
                    peer = CreatePeerForElement(cell);
                }

                if (peer != null)
                {
                    peer.RaiseAutomationEvent(AutomationEvents.InvokePatternOnInvoked);
                }
                break;
            }

            case DataGridEditingUnit.Row:
            {
                DataGridItemAutomationPeer peer = GetOrCreateItemPeer(row.DataContext);
                peer.RaiseAutomationEvent(AutomationEvents.InvokePatternOnInvoked);
                break;
            }
            }
        }
コード例 #2
0
        internal void RaiseAutomationInvokeEvents(DataGridEditingUnit editingUnit, DataGridColumn column, DataGridRow row)
        {
            switch (editingUnit)
            {
                case DataGridEditingUnit.Cell:
                    {
                        DataGridCell cell = row.Cells[column.Index];
                        AutomationPeer peer = FromElement(cell);
                        if (peer != null)
                        {
                            peer.InvalidatePeer();
                        }
                        else
                        {
                            peer = CreatePeerForElement(cell);
                        }

                        if (peer != null)
                        {
                            peer.RaiseAutomationEvent(AutomationEvents.InvokePatternOnInvoked);
                        }
                        break;
                    }
                case DataGridEditingUnit.Row:
                    {
                        DataGridItemAutomationPeer peer = GetOrCreateItemPeer(row.DataContext);
                        peer.RaiseAutomationEvent(AutomationEvents.InvokePatternOnInvoked);
                        break;
                    }
            }
        }