Bug 26862 - Text color in xaml when involving a command is not rendered (iOS only)
Summary: Text color in xaml when involving a command is not rendered (iOS only)
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.4
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-02-09 10:11 UTC by idot
Modified: 2016-04-08 19:22 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Xamarin logs (54.03 KB, application/zip)
2015-02-10 03:36 UTC, idot
Details
Sign in button text when command is defined (78.84 KB, image/png)
2015-02-10 05:44 UTC, idot
Details
Sign in button text when command is NOT defined (78.81 KB, image/png)
2015-02-10 05:48 UTC, idot
Details
simulator logs (55.70 KB, application/octet-stream)
2015-02-10 06:02 UTC, idot
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description idot 2015-02-09 10:11:22 UTC
I'm writing in Xamarin forms, and when I define a TextColor property on a Button, and a command, then the color I defined is overridden in iOS and the default color is used.

This is the button I'm trying to change it's text color:

When I removed the Command="{Binding Signin}", then the text color was black..

I'm using the latest stable Xamarin.iOS.
The device I checked on is a iOS simulator.

Thanks in advance,
Ido
Comment 1 Ram Chandra 2015-02-09 13:20:46 UTC
I have checked this issue but I am unable to reproduce this issue.

I have defined a TextColor property and a command on a button and when I deployed the app on simulator I observed that the text color is not overridden.
Button

Screencast: http://www.screencast.com/t/RfgDP90LBc

Could you please provide sample application,version of Xamarin.Forms, build info and simulator logs? So that we can reproduce this issue at our end.

You can get these  information from here:

Environment Info:
Xamarin Studio => About Xamarin Studio => Show details => Copy information

Simulator logs:
Select Simulator => Debug menu => Open System Log...

Environment Info:

Xamarin.Forms:1.3.3.6233

=== Xamarin Studio ===

Version 5.7.1 (build 17)
Installation UUID: 6ea47b0d-1852-4aaf-808d-373ff0a5002b
Runtime:
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.iOS ===

Version: 8.6.1.20 (Business Edition)
Hash: 3b3ef43
Branch: 
Build date: 2015-01-24 09:42:21-0500

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/jatin66/Desktop/Backup/android-sdk-macosx
	Supported Android versions:
		1.6    (API level 4)
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin.Mac ===

Version: 1.12.0.4 (Business Edition)

=== Build Information ===

Release ID: 507010017
Git revision: 0bc7d3550b6b088ac25b08dcf7bbe73bcc8658b3
Build date: 2015-02-03 19:43:29-05
Xamarin addins: f7b7d34419c9ec24501bfa7c658e80a6305613e0

=== Operating System ===

Mac OS X 10.10.0
Darwin Jatin66s-iMac.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 2 idot 2015-02-10 03:36:53 UTC
Created attachment 9739 [details]
Xamarin logs
Comment 3 idot 2015-02-10 05:44:43 UTC
Created attachment 9741 [details]
Sign in button text when command is defined
Comment 4 idot 2015-02-10 05:48:17 UTC
Created attachment 9742 [details]
Sign in button text when command is NOT defined
Comment 5 idot 2015-02-10 05:49:51 UTC
System info:
Microsoft Visual Studio Ultimate 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.51209

Installed Version: Ultimate

Architecture and Modeling Tools   06181-004-0449004-02299
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

LightSwitch for Visual Studio 2013   06181-004-0449004-02299
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06181-004-0449004-02299
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06181-004-0449004-02299
Microsoft Visual Basic 2013

Visual C# 2013   06181-004-0449004-02299
Microsoft Visual C# 2013

Visual C++ 2013   06181-004-0449004-02299
Microsoft Visual C++ 2013

Visual F# 2013   06181-004-0449004-02299
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06181-004-0449004-02299
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools   12.4.51016.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Microsoft Azure Websites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.21010.0
For additional information, visit http://www.asp.net/

Color Theme Designer   1.0
Designer for creating new color themes

Common Azure Tools   1.3
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JetBrains ReSharper Platform 6   Build 6.0.20141204.190160 on 2014-12-04 19:29:31Z
JetBrains ReSharper Platform package for Microsoft Visual Studio. For more information about ReSharper Platform, visit http://www.jetbrains.com/resharper. Copyright © 2015 JetBrains, Inc.

Microsoft Azure Mobile Services Tools   1.3
Microsoft Azure Mobile Services Tools

NuGet Package Manager   2.8.50926.663
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2013 ENU   12.0.30626
Microsoft Office Developer Tools for Visual Studio 2013 ENU

PowerShell Tools   1.3
Provides file classification services using PowerShell

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   12.0.41012.0
Microsoft SQL Server Data Tools

Windows Phone 8.1 SDK Integration   1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   3.9.236.0 (d6a2cae)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.20.0.34 (49a04b966feb40dfdba49d57ba16249b66d606a6)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.6.0.0 (eb24bdcf5cba2c12b673a07e0a8cce368b9563b3)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified
Comment 6 idot 2015-02-10 05:52:04 UTC
Button definition:
 <Button BackgroundColor="Olive"  WidthRequest="240" Text="{e:TranslationResource LoginView_Signin}" TextColor="Black" Command="{Binding Signin}"  HorizontalOptions="Center"></Button>
Comment 7 idot 2015-02-10 06:02:23 UTC
Created attachment 9743 [details]
simulator logs
Comment 8 idot 2015-02-10 06:08:25 UTC
Please let me know if you need more info

Thanks,
Ido
Comment 9 idot 2015-02-18 10:13:43 UTC
Have you managed to reproduce/solve this issue?
Comment 10 Ram Chandra 2015-02-18 11:42:10 UTC
Thanks for all the information.

I have checked this issue on Xamarin.Forms: 1.3.1.6296 and Xamarin.Forms:1.3.5.6333-pre1 but I am unable to reproduce this behavior, we may have to see if a developer can figure out what's going on from the stack trace. 

If you have a chance, it might also be helpful to include sample application.
Comment 11 idot 2015-03-02 03:40:00 UTC
I have more info for the bug, It happens when the command in the viewModel that is bounded to the page, uses Relay command with canExecute option (http://www.mvvmlight.net/help/SL5/html/d1d0472f-6d9e-6789-e9c8-f46f0e9c7fad.htm).

When I removed the validation of canExecute from the relayCommand, the text was rendered correctly.
 
Command With validation:

 public ICommand Signin
        {
            get
            {
                return _signInCommand ??
                       (_signInCommand = new RelayCommand(async () =>
                       {
                           try
                           {
                               IsLoading = true;

                               await _loginFlow.UserNamePasswordAuthFlow(Email, Password);
                           }
                           catch (Exception e)
                           {
                               IsLoading = false;
                               if (e is BusinessException && ((BusinessException)e).Code == "AuthenticationException")
                               {
                                   _dialogService.ShowMessage("Ooops... Worng credentials", "Error");
                               }
                               else
                               {
                                   _dialogService.ShowError(e, "Ooops... Something went wrong..", "OK", delegate
                                   {
                                       Password = string.Empty;

                                   });
                               }

                           }

                       }, () => !string.IsNullOrEmpty(Email) && !string.IsNullOrEmpty(Password)));
            }

Without:


     public ICommand Signin
        {
            get
            {
                return _signInCommand ??
                       (_signInCommand = new RelayCommand(async () =>
                       {
                           try
                           {
                               IsLoading = true;

                               await _loginFlow.UserNamePasswordAuthFlow(Email, Password);
                           }
                           catch (Exception e)
                           {
                               IsLoading = false;
                               if (e is BusinessException && ((BusinessException)e).Code == "AuthenticationException")
                               {
                                   _dialogService.ShowMessage("Ooops... Worng credentials", "Error");
                               }
                               else
                               {
                                   _dialogService.ShowError(e, "Ooops... Something went wrong..", "OK", delegate
                                   {
                                       Password = string.Empty;

                                   });
                               }

                           }

                       }));
            }
Comment 12 idot 2015-03-08 06:02:50 UTC
Do you guys have any updates regarding this bug?
Comment 13 Sami M. Kallio 2015-04-22 12:35:57 UTC
I suspect the cause for this bug is that the command returns false on CanExecute. The root cause is possibly the same as in this bug: https://bugzilla.xamarin.com/show_bug.cgi?id=29318
Comment 14 Samantha Houts [MSFT] 2016-04-08 19:22:33 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
 
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team