protected override string GetNameCore() { string nameCore = base.GetNameCore(); if (string.IsNullOrEmpty(nameCore)) { Label owner = base.Owner as Label; if ((owner != null) && (owner.Content != null)) { TextBlock content = owner.Content as TextBlock; nameCore = (content == null) ? owner.Content.ToString() : content.Text; } } return(nameCore); }
public LabelAutomationPeer(Label owner) : base((FrameworkElement)owner) { }