diff options
author | Paul DiPietro <pauldipietro@users.noreply.github.com> | 2016-08-30 13:47:09 -0500 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-08-30 11:47:09 -0700 |
commit | d8f9444ddb3e49b408a5431acf6fa43a226c434e (patch) | |
tree | e4fc7bcde77cac87834a79c49d32b193605207b5 /Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared | |
parent | 88b15d7d1f40a19d35ed5daed16bdfe2a32adc76 (diff) | |
download | xamarin-forms-d8f9444ddb3e49b408a5431acf6fa43a226c434e.tar.gz xamarin-forms-d8f9444ddb3e49b408a5431acf6fa43a226c434e.tar.bz2 xamarin-forms-d8f9444ddb3e49b408a5431acf6fa43a226c434e.zip |
[Win] Fix FontAttributes unexpectedly changing a label's size (#325)
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared')
2 files changed, 57 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43516.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43516.cs new file mode 100644 index 00000000..615f5a09 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43516.cs @@ -0,0 +1,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))) + } + } + }; + } + } +} diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems index c0f5d33a..adf173df 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems @@ -123,6 +123,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla42329.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla42364.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla42519.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Bugzilla43516.cs" /> <Compile Include="$(MSBuildThisFileDirectory)CarouselAsync.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla34561.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla34727.cs" /> |