b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

accessiblename_qt accessiblename_accessiblename属性

电脑杂谈  发布时间:2017-05-26 04:01:55  来源:网络整理

accessiblename_qt accessiblename_accessiblename属性

accessiblenameaccessiblename

1. Set the accessible name for an element from the accessible name of another element

Sometimes you want the accessible name of an element to always be the same as the accessible name of some other element. For example, the accessible name of a Slider bar might always want to be the accessible name of some nearby TextBlock. (By default the accessible name of a TextBlock is the same as the text shown visually on the TextBlock.) In that case, you can say that the Slider is labeled by the TextBlock.

In the following example, a Sliders accessible name is set from a TextBlock that lies near the Slider visually:

<Slider …

AutomationProperties.LabeledBy={Binding ElementName=CheeseAllowance}/>

<TextBlock …

Name=CheeseAllowance

x:Uid=CheeseAllowanceLabel />

Note that the LabeledBy binding only requires a Name rather than an x:Name.

I can then use Inspect to verify that the accessible name of the Slider has been set from the accessible name of the TextBlock.

Figure 1: Inspect showing the accessible names of my Slider and TextBlock.

Note: It is not possible to set a LabeledBy property in a style such that it is bound to an element in a custom control’s styles ControlTemplate, in the manner attempted below.

<Style TargetType=customControls:CheeseButton>

<Setter Property=AutomationProperties.LabeledBy

Value={Binding ElementName=PlaceholderText} /> <- THIS BINDING WILL NOT WORK!


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-49289-1.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...