Skip to content

Commit 41491ee

Browse files
committed
Altered GetNameCore to default to return the base implementation when alternative options don't return results.
1 parent f42f236 commit 41491ee

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

Microsoft.Toolkit.Uwp.UI.Controls/Carousel/CarouselAutomationPeer.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,7 @@ protected override string GetNameCore()
9494
return name;
9595
}
9696

97-
name = base.GetNameCore();
98-
if (!string.IsNullOrEmpty(name))
99-
{
100-
return name;
101-
}
102-
103-
return string.Empty;
97+
return base.GetNameCore();
10498
}
10599

106100
/// <summary>

Microsoft.Toolkit.Uwp.UI.Controls/Carousel/CarouselItemAutomationPeer.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,7 @@ protected override string GetNameCore()
123123
return textBlock.Text;
124124
}
125125

126-
name = base.GetNameCore();
127-
if (!string.IsNullOrEmpty(name))
128-
{
129-
return name;
130-
}
131-
132-
return string.Empty;
126+
return base.GetNameCore();
133127
}
134128

135129
/// <summary>
@@ -209,7 +203,7 @@ protected override int GetPositionInSetCore()
209203

210204
CarouselItem owner = this.OwnerCarouselItem;
211205
Carousel parent = owner.ParentCarousel;
212-
positionInSet = parent.IndexFromContainer(owner);
206+
positionInSet = parent.IndexFromContainer(owner) + 1;
213207

214208
return positionInSet;
215209
}

0 commit comments

Comments
 (0)