internal DataGridCellItemAutomationPeer GetOrCreateCellItemPeer(DataGridColumn column) { DataGridCellItemAutomationPeer peer = null; bool peerExists = _itemPeers.TryGetValue(column, out peer); if (!peerExists || peer == null) { peer = new DataGridCellItemAutomationPeer(_item, column); _itemPeers.Add(column, peer); } return peer; }
internal List<AutomationPeer> GetCellItemPeers() { List<AutomationPeer> peers = new List<AutomationPeer>(); Dictionary<DataGridColumn, DataGridCellItemAutomationPeer> oldChildren = new Dictionary<DataGridColumn, DataGridCellItemAutomationPeer>(_itemPeers); _itemPeers.Clear(); foreach (DataGridColumn column in this.OwningDataGrid.Columns) { DataGridCellItemAutomationPeer peer = null; bool peerExists = oldChildren.TryGetValue(column, out peer); if (!peerExists || peer == null) { peer = new DataGridCellItemAutomationPeer(_item, column); } peers.Add(peer); _itemPeers.Add(column, peer); } return peers; }