summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul DiPietro <pauldipietro@users.noreply.github.com>2016-12-19 12:45:15 (GMT)
committerRui Marinho <me@ruimarinho.net>2016-12-19 12:45:15 (GMT)
commitdf67dff982d45e6fb8d69b549b8683ca26f2a202 (patch)
treecf911d43a319cb2df65d39c12ef2bcc9c18a8d15
parente0165abbcd1329a3dfd353548f5d75eef0c792de (diff)
downloadxamarin-forms-df67dff982d45e6fb8d69b549b8683ca26f2a202.zip
xamarin-forms-df67dff982d45e6fb8d69b549b8683ca26f2a202.tar.gz
xamarin-forms-df67dff982d45e6fb8d69b549b8683ca26f2a202.tar.bz2
[UWP] Use toolbar foreground color on primary items (#640)
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44453.cs55
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems1
-rw-r--r--Xamarin.Forms.Platform.WinRT/Platform.cs9
3 files changed, 62 insertions, 3 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44453.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44453.cs
new file mode 100644
index 0000000..c1f64ac
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44453.cs
@@ -0,0 +1,55 @@
+´╗┐using Xamarin.Forms.CustomAttributes;
+using Xamarin.Forms.Internals;
+
+#if UITEST
+using Xamarin.UITest;
+using NUnit.Framework;
+#endif
+
+// Apply the default category of "Issues" to all of the tests in this assembly
+// We use this as a catch-all for tests which haven't been individually categorized
+#if UITEST
+[assembly: NUnit.Framework.Category("Issues")]
+#endif
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.Bugzilla, 44453, "[UWP] ToolbarItem Text hard to see when BarTextColor is light", PlatformAffected.WinRT)]
+ public class Bugzilla44453 : TestMasterDetailPage
+ {
+ protected override void Init()
+ {
+ var content = new ContentPage
+ {
+ Title = "UWPToolbarItemColor",
+ Content = new StackLayout
+ {
+ VerticalOptions = LayoutOptions.Center,
+ Children =
+ {
+ new Label
+ {
+ LineBreakMode = LineBreakMode.WordWrap,
+ HorizontalTextAlignment = TextAlignment.Center,
+ Text = "The toolbar secondary items should not have white text on a light background"
+ }
+ }
+ }
+ };
+
+ MasterBehavior = MasterBehavior.Popover;
+ Master = new ContentPage
+ {
+ Title = "Master"
+ };
+ Detail = new NavigationPage(content)
+ {
+ BarBackgroundColor = Color.Green,
+ BarTextColor = Color.White
+ };
+
+ Detail.ToolbarItems.Add(new ToolbarItem("Test Secondary Item", null, delegate { }, ToolbarItemOrder.Secondary));
+ }
+ }
+} \ No newline at end of file
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 57f1cb8..a420489 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
@@ -134,6 +134,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43469.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43516.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43663.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla44453.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla44944.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla44166.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla44461.cs" />
diff --git a/Xamarin.Forms.Platform.WinRT/Platform.cs b/Xamarin.Forms.Platform.WinRT/Platform.cs
index e9f6b95..2e30ac1 100644
--- a/Xamarin.Forms.Platform.WinRT/Platform.cs
+++ b/Xamarin.Forms.Platform.WinRT/Platform.cs
@@ -296,13 +296,16 @@ namespace Xamarin.Forms.Platform.WinRT
button.Command = new MenuItemCommand(item);
button.DataContext = item;
-#if WINDOWS_UWP
- toolBarProvider?.BindForegroundColor(button);
-#endif
ToolbarItemOrder order = item.Order == ToolbarItemOrder.Default ? ToolbarItemOrder.Primary : item.Order;
+
if (order == ToolbarItemOrder.Primary)
+ {
+#if WINDOWS_UWP
+ toolBarProvider?.BindForegroundColor(button);
+#endif
commandBar.PrimaryCommands.Add(button);
+ }
else
commandBar.SecondaryCommands.Add(button);
}