Example #1
0
        internal void RaiseAutomationFocusChangedEvent(int slot, int column)
        {
            if (slot >= 0 && slot < this.OwningDataGrid.SlotCount &&
                column >= 0 && column < this.OwningDataGrid.ColumnsItemsInternal.Count &&
                this.OwningDataGrid.IsSlotVisible(slot))
            {
                if (this.OwningDataGrid.RowGroupHeadersTable.Contains(slot))
                {
                    DataGridRowGroupHeader header = this.OwningDataGrid.DisplayData.GetDisplayedElement(slot) as DataGridRowGroupHeader;
                    if (header != null)
                    {
                        AutomationPeer headerPeer = CreatePeerForElement(header);
                        if (headerPeer != null)
                        {
#if DEBUG_AUTOMATION
                            Debug.WriteLine(headerPeer.ToString() + ".RaiseAutomationEvent(AutomationEvents.AutomationFocusChanged)");
#endif
                            headerPeer.RaiseAutomationEvent(AutomationEvents.AutomationFocusChanged);
                        }
                    }
                }
                else
                {
                    AutomationPeer cellPeer = GetCellPeer(slot, column);
                    if (cellPeer != null)
                    {
#if DEBUG_AUTOMATION
                        Debug.WriteLine(cellPeer.ToString() + ".RaiseAutomationEvent(AutomationEvents.AutomationFocusChanged)");
#endif
                        cellPeer.RaiseAutomationEvent(AutomationEvents.AutomationFocusChanged);
                    }
                }
            }
        }
Example #2
0
        internal void RaiseAutomationCellSelectedEvent(int slot, int column)
        {
            AutomationPeer cellPeer = GetCellPeer(slot, column);

            if (cellPeer != null)
            {
#if DEBUG_AUTOMATION
                Debug.WriteLine(cellPeer.ToString() + ".RaiseAutomationEvent(AutomationEvents.SelectionItemPatternOnElementSelected)");
#endif
                cellPeer.RaiseAutomationEvent(AutomationEvents.SelectionItemPatternOnElementSelected);
            }
        }
Example #3
0
        internal static void RaiseAutomationInvokeEvent(UIElement element)
        {
            if (AutomationPeer.ListenerExists(AutomationEvents.InvokePatternOnInvoked))
            {
                AutomationPeer peer = FrameworkElementAutomationPeer.FromElement(element);
                if (peer != null)
                {
#if DEBUG_AUTOMATION
                    Debug.WriteLine(peer.ToString() + ".RaiseAutomationEvent(AutomationEvents.InvokePatternOnInvoked)");
#endif
                    peer.RaiseAutomationEvent(AutomationEvents.InvokePatternOnInvoked);
                }
            }
        }
Example #4
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)
                {
#if DEBUG_AUTOMATION
                    Debug.WriteLine(peer.ToString() + ".RaiseAutomationEvent(AutomationEvents.InvokePatternOnInvoked)");
#endif
                    peer.RaiseAutomationEvent(AutomationEvents.InvokePatternOnInvoked);
                }

                break;
            }

            case DataGridEditingUnit.Row:
            {
                DataGridItemAutomationPeer peer = GetOrCreateItemPeer(row.DataContext);
#if DEBUG_AUTOMATION
                Debug.WriteLine("DataGridItemAutomationPeer.RaiseAutomationEvent(AutomationEvents.InvokePatternOnInvoked)");
#endif
                peer.RaiseAutomationEvent(AutomationEvents.InvokePatternOnInvoked);
                break;
            }
            }
        }