Bug 28556 - [All Platforms] Style triggers do not operate correctly when object is disabled initially
Summary: [All Platforms] Style triggers do not operate correctly when object is disabl...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.1
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-03-30 12:44 UTC by Cody Beyer (MSFT)
Modified: 2015-06-15 15:33 UTC (History)
7 users (show)

Tags: all functional triggers AC
Is this bug a regression?: ---
Last known good build:


Attachments
TestCase (1.08 MB, application/zip)
2015-05-20 17:18 UTC, Cody Beyer (MSFT)
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 Cody Beyer (MSFT) 2015-03-30 12:44:12 UTC
### Description 

When using Style Triggers to color the background of an Entry, the trigger only
operates as expected if it is enabled initially. Disabled items do not appear
to be affected by style triggers once they are enabled

### Test Case

https://www.dropbox.com/s/xnavpz7fi2e29it/XamarinBugs.zip?dl=0

### Video

https://www.dropbox.com/s/rcjsgv7svaxlyne/StyleTrigger.mov?dl=0

### Steps to Reproduce

1. Open test case
2. Deploy to iOS or Android Emulator
3. Tap on "TriggerStyles" on launch page
4. Notice the 2nd child which is purple (indicating disabled)
5. Click the "Toggle Enabled" button

### Expected Results

The 2nd child, which is initially disabled, should become green to indicate
enabled, while the other children should become purple

### Actual Results

The 2nd child becomes white, while the others become purple

### Version

=== Xamarin Studio ===

Version 5.8.1 (build 8)
Installation UUID: 48d20a9d-ef72-44de-8690-d8fa00873cc7
Runtime:
    Mono 3.12.1 ((detached/b63df7d)
    GTK+ 2.24.23 (Raleigh theme)

    Package version: 312010002

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.iOS ===

Version: 8.8.1.9 (Business Edition)
Hash: 7e1f69e
Branch: 
Build date: 2015-03-12 15:35:49-0400

=== Xamarin.Android ===

Version: 4.20.1.0 (Business Edition)
Android SDK: /Users/codybeyer/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        2.1   (API level 7)
        2.2   (API level 8)
        2.3   (API level 10)
        3.1   (API level 12)
        4.0.3 (API level 15)
        4.4   (API level 19)
        5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 1.12.0.14 (Business Edition)

=== Build Information ===

Release ID: 508010008
Git revision: f8e52bf493869b6a320a95400553dc9ea8b7ef22
Build date: 2015-03-13 16:16:49-04
Xamarin addins: 84d611cc17567a68daad719327e90af06d2ae327

=== Operating System ===

Mac OS X 10.10.2
Darwin Codys-MacBook-Pro.local 14.1.0 Darwin Kernel Version 14.1.0
    Thu Feb 26 19:26:47 PST 2015
    root:xnu-2782.10.73~1/RELEASE_X86_64 x86_64
Comment 1 Rajneesh Kumar 2015-03-30 15:10:17 UTC
I have checked this issue and able to reproduce this. To reproduce this issue I have followed the steps and instruction provided in bug description.

After deploying the application on emulator, and when click on the "Toggle Enabled" button I observed that the second child becomes white, while the others become purple. Please refer the screencast for the same: Screencast: http://www.screencast.com/t/8gyQ1q5SBB8V

Ide Logs: https://gist.github.com/Parmendrak/a4e293c76e8be7057de6
Application Output: https://gist.github.com/Parmendrak/506cdca129c8698e3b33

Environment info: 1.4.1.6347-pre2

Xamarin.Forms Version: 

=== Xamarin Studio ===

Version 5.8.2 (build 5)
Installation UUID: 1a096c6f-0678-402e-89b2-a2c10f7e80e4
Runtime:
	Mono 3.12.1 ((detached/0849ec7)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312010003

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.iOS ===

Version: 8.8.2.2 (Business Edition)
Hash: f5d0c5e
Branch: 
Build date: 2015-03-20 06:51:49-0400

=== Xamarin.Android ===

Version: 4.20.1.0 (Business Edition)
Android SDK: /Users/360_macmini/Desktop/android-sdk-macosx
	Supported Android versions:
		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.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 1.12.0.14 (Business Edition)

=== Build Information ===

Release ID: 508020005
Git revision: 541c06a4f6c95383333375d56fd6c23ce48cb916
Build date: 2015-03-20 09:23:08-04
Xamarin addins: 02510c4990dee3475c282b3182d588975a63ff07

=== Operating System ===

Mac OS X 10.9.4
Darwin ShrutiMac.local 13.3.0 Darwin Kernel Version 13.3.0
    Tue Jun  3 21:27:35 PDT 2014
    root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2015-04-07 15:16:05 UTC
## Partial workaround (at least for this particular test case)


Disable the control later in the page rendering process. For example:


1. Switch `sampleDisabledEntry` to have `IsEnabled="true"` in `TriggerStylesPage.xaml`.


2 Add the following code to the `TriggerStylesPage` class in `TriggerStylesPage.xaml.cs` (remove the > greater-than characters from the beginning of each line):

> protected override void LayoutChildren(double x, double y, double width, double height)
> {
>     base.LayoutChildren(x, y, width, height);
>
>     sampleDisabledEntry.IsEnabled = false;
> }
Comment 3 ppatarinski@paylocity.com 2015-04-08 15:38:26 UTC
Brendan that works. 

For bindable properties I did the following : 

Set control to IsEnabled = True in Xaml

In code behind : 

  protected override void LayoutChildren(double x, double y, double width, double height)
      {
        base.LayoutChildren(x, y, width, height);

        SubmitButton.SetBinding<ViewModel>(IsEnabledProperty, vm => vm.IsSubmitEnabled);
      }

Any idea on when this bug will actually be fixed?
Comment 4 ppatarinski@paylocity.com 2015-04-22 12:09:30 UTC
Is there an update to this? Will this be fixed in a future build?
Comment 5 ppatarinski@paylocity.com 2015-04-30 11:34:54 UTC
Update?
Comment 6 Cody Beyer (MSFT) 2015-05-20 17:18:30 UTC
Created attachment 11266 [details]
TestCase
Comment 7 Jason Smith [MSFT] 2015-06-15 15:33:39 UTC
Should be fixed in 1.4.3 final