summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43516.cs
blob: 615f5a09a7c3479a275ea17e9efbc8d5b15c895d (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
using System;

using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif

namespace Xamarin.Forms.Controls.Issues
{
	[Preserve(AllMembers = true)]
	[Issue(IssueTracker.Bugzilla, 43516, "Changing FontAttributes on a label to None changes its font size")]
	public class Bugzill43516 : TestContentPage
	{
		protected override void Init()
		{
			var label = new Label
			{
				FontAttributes = FontAttributes.Bold
			};
			label.BindingContext = label;
			label.SetBinding(Label.TextProperty, "FontAttributes");

			Content = new StackLayout
			{
				Children =
				{
					label,
					new Button
					{
						Text = "Click to set FontAttributes.None",
						Command = new Command(() =>
						{
							label.FontAttributes = FontAttributes.None;
						})
					},
					new Button
					{
						Text = "Click to set FontAttributes.Bold",
						Command = new Command(() =>
						{
							label.FontAttributes = FontAttributes.Bold;
						})
					},
					new Button
					{
						Text = "Click to set Font.SystemFontOfSize to NamedSize.Medium",
						Command = new Command(() => label.FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)))
					}
				}
			};
		}
	}
}