SelectionItemPattern

支持SelectionItemPattern的控件有ListViewListBoxRadioButtonGridView等。

1.         SelectionItemPattern的三个重要方法:

1.         AddToSelection:将当前元素添加到所选项的集合。

2.         RemoveFromSelection: 从选定项的集合中移除当前元素。

3.         Select: 取消所有已选中的项,然后选择当前元素。

2.         SelectionItemPatternCurrent属性
可通过Current属性的IsSelected属性来判断AutomationElement是否被selected.

     如下代码演示了使用SelectionItemPattern来操作RadioButton控件。

     以下代码为XAML

    本文简单介绍了SelectionItemPattern以及使用SelectionItemPattern来操作RadioButton

相关文章:

  • 2022-02-07
  • 2021-11-30
  • 2021-07-13
  • 2021-11-18
  • 2021-11-29
  • 2021-12-04
  • 2021-07-18
  • 2021-07-24
猜你喜欢
  • 2022-12-23
  • 2021-05-24
  • 2021-07-20
  • 2021-05-21
  • 2021-11-18
相关资源
相似解决方案