protected override string GetAutomationIdCore()
        {
            QueryAutomationIdRoutedEventArgs args = new QueryAutomationIdRoutedEventArgs(
                AutomationQueryEvents.QueryAutomationIdForGroupEvent, m_uiGroupOwner);

            m_uiGroupOwner.DataGridContext.DataGridControl.RaiseEvent(args);

            string automationId = null;

            if (args.Handled)
            {
                automationId = args.AutomationId;
            }

            if (automationId == null)
            {
                if (m_uiGroupOwner.Value != null)
                {
                    return(string.Format(
                               CultureInfo.InvariantCulture,
                               "Group_{0}:{1}_{2}",
                               m_uiGroupOwner.Level, m_uiGroupOwner.GroupBy, m_uiGroupOwner.Value));
                }

                return(string.Empty);
            }

            return(automationId);
        }
Пример #2
0
        protected override string GetAutomationIdCore()
        {
            string automationId = null;

            if (m_dataGridContext != null)
            {
                QueryAutomationIdRoutedEventArgs args = new QueryAutomationIdRoutedEventArgs(
                    AutomationQueryEvents.QueryAutomationIdForDetailEvent, m_dataGridContext);

                m_dataGridControl.RaiseEvent(args);

                if (args.Handled)
                {
                    automationId = args.AutomationId;
                }
            }

            if (automationId == null)
            {
                return("Detail_" + m_detailConfiguration.RelationName);
            }

            return(automationId);
        }