Пример #1
0
        protected override string GetNameCore()
        {
            if (_owner.ContentTemplateRoot is MessageSelector selector)
            {
                var bubble = selector.Content as MessageBubble;
                if (bubble != null)
                {
                    return(bubble.GetAutomationName() ?? base.GetNameCore());
                }
            }
            else if (_owner.ContentTemplateRoot is MessageBubble child)
            {
                return(child.GetAutomationName() ?? base.GetNameCore());
            }
            else if (_owner.Content is Message message && _protoService != null)
            {
                return(Automation.GetDescription(_protoService, message));
            }

            return(base.GetNameCore());
        }