///
        protected override string GetAutomationIdCore()
        {
            AutomationPeer wrapperPeer = OwningCellPeer;

            if (wrapperPeer != null)
            {
                return(wrapperPeer.GetAutomationId());
            }
            else
            {
                ThrowElementNotAvailableException();
            }

            return(string.Empty);
        }
Example #2
0
        ///
        protected override string GetAutomationIdCore()
        {
            AutomationPeer wrapperPeer = GetWrapperPeer();
            string         id          = null;

            if (wrapperPeer != null)
            {
                id = wrapperPeer.GetAutomationId();
            }
            else if (_item != null)
            {
                using (RecyclableWrapper recyclableWrapper = ItemsControlAutomationPeer.GetRecyclableWrapperPeer(_item))
                {
                    id = recyclableWrapper.Peer.GetAutomationId();
                }
            }

            return(id);
        }
Example #3
0
        /// <summary>Gets the string that uniquely identifies the <see cref="T:System.Windows.UIElement" /> that corresponds to the data item in the <see cref="P:System.Windows.Controls.ItemsControl.Items" /> collection that is associated with this <see cref="T:System.Windows.Automation.Peers.ItemAutomationPeer" />. </summary>
        /// <returns>A string that contains the UI Automation identifier.</returns>
        // Token: 0x0600271D RID: 10013 RVA: 0x000B8F70 File Offset: 0x000B7170
        protected override string GetAutomationIdCore()
        {
            AutomationPeer wrapperPeer = this.GetWrapperPeer();
            string         result      = null;
            object         item;

            if (wrapperPeer != null)
            {
                result = wrapperPeer.GetAutomationId();
            }
            else if ((item = this.Item) != null)
            {
                using (RecyclableWrapper recyclableWrapperPeer = this.ItemsControlAutomationPeer.GetRecyclableWrapperPeer(item))
                {
                    result = recyclableWrapperPeer.Peer.GetAutomationId();
                }
            }
            return(result);
        }
Example #4
0
 private static object GetAutomationId(AutomationPeer peer)          {   return peer.GetAutomationId();  }