summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40139.cs
blob: a79d32a4414bcc05fdbb23d75b944bff84a184bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
using System.Collections.Generic;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

namespace Xamarin.Forms.Controls.Issues
{
	[Preserve(AllMembers = true)]
	[Issue(IssueTracker.Bugzilla, 40139, "Changing the Windows 10 System Theme Color causes ListView text to disappear.",
		PlatformAffected.WinRT)]
	public class Bugzilla40139 : TestContentPage
	{
		protected override void Init()
		{
			var lv = new ListView
			{
				ItemsSource = new List<Color>
				{
					Color.Aqua,
					Color.Black,
					Color.Blue,
					Color.Fuchsia,
					Color.Gray,
					Color.Green,
					Color.Lime,
					Color.Maroon,
					Color.Navy
				},
				BackgroundColor = Color.Gray,
				ItemTemplate = new DataTemplate(typeof(_40139ViewCell))
			};

			var layout = new StackLayout
			{
				Children =
				{
					new Label
					{
						Text =
							"On your machine, go to Settings -> Personalization -> Colors and change the accent color for your system. If the text of the controls in the list disappears, this test has failed."
					},
					lv
				}
			};

			Content = layout;
		}

		[Preserve(AllMembers = true)]
		public class _40139ViewCell : ViewCell
		{
			public _40139ViewCell()
			{
				var label = new Label
				{
					Text = "abc",
					VerticalOptions = LayoutOptions.Center,
					TextColor = Color.White,
					FontFamily = "Consolas",
					FontSize = 24,
					BackgroundColor = Color.Chartreuse
				};

				var entry = new Entry
				{
					Placeholder = "Placeholder",
					TextColor = Color.Coral
				};

				var button = new Button
				{
					Text = "Button",
					TextColor = Color.Coral
				};

				var layout = new StackLayout();
				layout.Children.Add(label);

				layout.Children.Add(entry);
				layout.Children.Add(button);

				var image = new Image { Source = "coffee.png" };
				layout.Children.Add(image);

				View = layout;
			}
		}
	}
}