@@ -5,12 +5,10 @@ namespace Controls.TestCases.HostApp.Issues;
5
5
[ Issue ( IssueTracker . Github , 7144 , "IndicatorView using templated icons not working" , PlatformAffected . UWP ) ]
6
6
public class Issue7144 : ContentPage
7
7
{
8
- public ObservableCollection < Issue7144Monkey > Monkeys { get ; set ; } = new ObservableCollection < Issue7144Monkey > ( ) ;
8
+ ObservableCollection < string > Items { get ; set ; } = new ObservableCollection < string > ( ) { "Item1" , "Item2" } ;
9
9
10
10
public Issue7144 ( )
11
11
{
12
- CreateMonkeyCollection ( ) ;
13
-
14
12
Grid grid = new Grid ( ) ;
15
13
grid . RowDefinitions . Add ( new RowDefinition { Height = GridLength . Star } ) ;
16
14
grid . RowDefinitions . Add ( new RowDefinition { Height = GridLength . Auto } ) ;
@@ -35,78 +33,46 @@ public Issue7144()
35
33
return image ;
36
34
} ) ;
37
35
38
- CarouselView carouselViewWithIndicatorView = new CarouselView
36
+ CarouselView carouselView = new CarouselView
39
37
{
40
- ItemsSource = Monkeys ,
38
+ ItemsSource = Items ,
41
39
Loop = false ,
42
40
IndicatorView = indicatorViewWithDataTemplate ,
43
41
ItemTemplate = new DataTemplate ( ( ) =>
44
42
{
45
43
StackLayout stackLayout = new StackLayout ( ) ;
46
44
47
- Label nameLabel = new Label
45
+ Label label = new Label
48
46
{
49
47
FontAttributes = FontAttributes . Bold ,
50
48
FontSize = 24 ,
51
49
HorizontalOptions = LayoutOptions . Center ,
52
50
VerticalOptions = LayoutOptions . Center
53
51
} ;
54
- nameLabel . SetBinding ( Label . TextProperty , "Name" ) ;
55
-
56
- Image image = new Image
57
- {
58
- Aspect = Aspect . Fill ,
59
- HeightRequest = 150 ,
60
- WidthRequest = 150 ,
61
- HorizontalOptions = LayoutOptions . Center
62
- } ;
63
- image . SetBinding ( Image . SourceProperty , "Image" ) ;
52
+ label . SetBinding ( Label . TextProperty , "." ) ; ;
64
53
65
- stackLayout . Children . Add ( nameLabel ) ;
66
- stackLayout . Children . Add ( image ) ;
54
+ stackLayout . Children . Add ( label ) ;
67
55
68
56
return stackLayout ;
69
57
} )
70
58
} ;
71
59
72
60
Label label = new Label
73
61
{
74
- AutomationId = "IndicatorViewWithDataTemplate " ,
62
+ AutomationId = "descriptionLabel " ,
75
63
Text = "The test case fails if the IndicatorView DataTemplate is not displayed" ,
76
64
FontAttributes = FontAttributes . Bold ,
77
65
FontSize = 24 ,
78
66
HorizontalOptions = LayoutOptions . Center ,
79
67
VerticalOptions = LayoutOptions . Center
80
68
} ;
81
69
82
- grid . Add ( carouselViewWithIndicatorView , 0 , 0 ) ;
70
+ grid . Add ( carouselView , 0 , 0 ) ;
83
71
grid . Add ( indicatorViewWithDataTemplate , 0 , 1 ) ;
84
72
grid . Add ( label , 0 , 2 ) ;
85
73
86
74
Content = grid ;
87
75
}
88
-
89
- void CreateMonkeyCollection ( )
90
- {
91
- Monkeys . Add ( new Issue7144Monkey
92
- {
93
- Name = "Baboon" ,
94
- Image = "dotnet_bot.png"
95
- } ) ;
96
-
97
- Monkeys . Add ( new Issue7144Monkey
98
- {
99
- Name = "Capuchin Monkey" ,
100
- Image = "dotnet_bot.png"
101
- } ) ;
102
- }
103
- }
104
-
105
- public class Issue7144Monkey
106
- {
107
- public string Name { get ; set ; }
108
-
109
- public string Image { get ; set ; }
110
76
}
111
77
112
78
0 commit comments