|
3 | 3 | // See the LICENSE file in the project root for more information. |
4 | 4 |
|
5 | 5 | using System.Collections.Generic; |
6 | | -using System.Linq; |
7 | 6 | using Microsoft.Toolkit.Uwp.UI.Controls; |
| 7 | +using Windows.UI.Xaml.Automation; |
8 | 8 | using Windows.UI.Xaml.Automation.Peers; |
9 | 9 | using Windows.UI.Xaml.Automation.Provider; |
10 | 10 | using Windows.UI.Xaml.Controls; |
@@ -33,7 +33,7 @@ public CarouselAutomationPeer(Carousel owner) |
33 | 33 |
|
34 | 34 | /// <summary>Gets a value indicating whether the UI Automation provider requires at least one child element to be selected.</summary> |
35 | 35 | /// <returns>True if selection is required; otherwise, false.</returns> |
36 | | - public bool IsSelectionRequired => false; |
| 36 | + public bool IsSelectionRequired => true; |
37 | 37 |
|
38 | 38 | private Carousel OwningCarousel |
39 | 39 | { |
@@ -82,24 +82,25 @@ protected override string GetClassNameCore() |
82 | 82 | /// </returns> |
83 | 83 | protected override string GetNameCore() |
84 | 84 | { |
85 | | - string name = string.Empty; |
86 | | - |
87 | | - if (this.OwningCarousel != null) |
| 85 | + string name = AutomationProperties.GetName(this.OwningCarousel); |
| 86 | + if (!string.IsNullOrEmpty(name)) |
88 | 87 | { |
89 | | - name = this.OwningCarousel.Name; |
| 88 | + return name; |
90 | 89 | } |
91 | 90 |
|
92 | | - if (string.IsNullOrEmpty(name)) |
| 91 | + name = this.OwningCarousel.Name; |
| 92 | + if (!string.IsNullOrEmpty(name)) |
93 | 93 | { |
94 | | - name = base.GetNameCore(); |
| 94 | + return name; |
95 | 95 | } |
96 | 96 |
|
97 | | - if (string.IsNullOrEmpty(name)) |
| 97 | + name = base.GetNameCore(); |
| 98 | + if (!string.IsNullOrEmpty(name)) |
98 | 99 | { |
99 | | - name = this.GetClassName(); |
| 100 | + return name; |
100 | 101 | } |
101 | 102 |
|
102 | | - return name; |
| 103 | + return string.Empty; |
103 | 104 | } |
104 | 105 |
|
105 | 106 | /// <summary> |
|
0 commit comments