Пример #1
0
        protected override string GetNameCore()
        {
            string name = base.GetNameCore();

            if (string.IsNullOrEmpty(name))
            {
                if (Owner is PagerControl pagerControl)
                {
                    name = SharedHelpers.TryGetStringRepresentationFromObject(pagerControl.GetValue(AutomationProperties.NameProperty));
                }
            }

            return(name);
        }
Пример #2
0
        protected override string GetNameCore()
        {
            string returnHString = base.GetNameCore();

            // If a name hasn't been provided by AutomationProperties.Name in markup:
            if (string.IsNullOrEmpty(returnHString))
            {
                var tvi = Owner as TabViewItem;
                if (tvi != null)
                {
                    returnHString = SharedHelpers.TryGetStringRepresentationFromObject(tvi.Header);
                }
            }

            return(returnHString);
        }
        protected override string GetNameCore()
        {
            //Check to see if the item has a defined Automation Name
            string nameHString = base.GetNameCore();

            if (string.IsNullOrEmpty(nameHString))
            {
                var treeViewNode = GetTreeViewNode();
                if (treeViewNode != null)
                {
                    nameHString = SharedHelpers.TryGetStringRepresentationFromObject(treeViewNode.Content);
                }

                if (string.IsNullOrEmpty(nameHString))
                {
                    nameHString = "TreeViewNode";
                }
            }

            return(nameHString);
        }
        protected override string GetNameCore()
        {
            string returnHString = base.GetNameCore();

            // If a name hasn't been provided by AutomationProperties.Name in markup:
            if (string.IsNullOrEmpty(returnHString))
            {
                if (Owner is NavigationViewItem lvi)
                {
                    returnHString = SharedHelpers.TryGetStringRepresentationFromObject(lvi.Content);
                }
            }

            if (string.IsNullOrEmpty(returnHString))
            {
                // NB: It'll be up to the app to determine the automation label for
                // when they're using a PlaceholderValue vs. Value.

                returnHString = Strings.NavigationViewItemDefaultControlName;
            }

            return(returnHString);
        }