예제 #1
0
        private void Control_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
        {
            var senderTooltip = ((Control)sender).ToolTip;

            sbitxtDescription.Text = senderTooltip.ToString();
            sbiTitle.Content       = (AutomationProperties.GetLabeledBy(sender as DependencyObject) as Label).Content;
        }
        ///
        protected override AutomationPeer GetLabeledByCore()
        {
            UIElement element = AutomationProperties.GetLabeledBy(_owner);
            if (element != null)
                return element.GetAutomationPeer();

            return null;
        }
        protected void UpdateAutomationLabeledBy()
        {
            var label = AutomationProperties.GetLabeledBy(Element);

            if (label != null)
            {
                WAutomationProperties.SetLabeledBy(Control, Platform.GetRenderer(label)?.GetNativeElement());
            }
        }
예제 #4
0
        protected override AutomationPeer GetLabeledByCore()
        {
            if (AutomationProperties.GetLabeledBy(Owner) is IFrameworkElement label)             // TODO: UIElement
            {
                return(label.GetAutomationPeer());
            }

            return(base.GetLabeledByCore());
        }
예제 #5
0
        ///
        override protected AutomationPeer GetLabeledByCore()
        {
            UIElement element = AutomationProperties.GetLabeledBy(_owner);

            if (element != null)
            {
                return(element.GetAutomationPeer());
            }

            return(null);
        }
예제 #6
0
 private void AddCustomerAddressLine(TextBox textbox, string value)
 {
     if (string.IsNullOrEmpty(value.Trim()))
     {
         ((Label)AutomationProperties.GetLabeledBy(textbox)).Visibility = Visibility.Collapsed;
         textbox.Visibility = Visibility.Collapsed;
     }
     else
     {
         textbox.Text = value;
     }
 }
예제 #7
0
        public void LabeledByPropertyTest()
        {
            Assert.IsNotNull(AutomationProperties.LabeledByProperty, "#0");

            TextBlock block     = new TextBlock();
            TextBlock labeledBy = new TextBlock();

            block.SetValue(AutomationProperties.LabeledByProperty, labeledBy);
            Assert.AreEqual(AutomationProperties.GetLabeledBy(block),
                            block.GetValue(AutomationProperties.LabeledByProperty), "#1");

            Assert.AreSame(labeledBy, AutomationProperties.GetLabeledBy(block), "#2");
            Assert.AreSame(labeledBy, block.GetValue(AutomationProperties.LabeledByProperty), "#3");
        }
        protected override AutomationPeer?GetLabeledByCore()
        {
            var label = AutomationProperties.GetLabeledBy(Owner);

            return(label is Control c?GetOrCreate(c) : null);
        }