Bug 25662 - Setting IsEnabled does not disable SwitchCell in Forms listview
Summary: Setting IsEnabled does not disable SwitchCell in Forms listview
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 1.2.3
Hardware: PC Mac OS
: Highest major
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-12-30 23:40 UTC by Prashant Cholachagudda
Modified: 2017-12-05 17:16 UTC (History)
20 users (show)

Tags: AC uwp switchcell isenabled fr
Is this bug a regression?: ---
Last known good build:


Attachments
repro project (294.64 KB, application/x-zip-compressed)
2017-07-18 22:54 UTC, Jimmy [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 Prashant Cholachagudda 2014-12-30 23:40:52 UTC
Trying to set isEnabled = false of the SwitchCell; however it has no effect - it is still interactive.
The expected result is similar to EntryCell.IsEnabled = false (Grayed out and inaccessible ).

Sample code:

	public class App
	{
		public static Page GetMainPage ()
		{	
			var list = new ListView { 
				ItemsSource = new[] { 
					"One", "Two", "Three" 
				} 
			};
			var myPage = new ContentPage { 
				Content = list,
				Title = "My page"
			};

			list.ItemTemplate = new DataTemplate (typeof(MySwitch));

			return myPage;
		}
	}

	class MySwitch : SwitchCell{
		public MySwitch ()
		{
			IsEnabled = false;
		}
	}
Comment 1 Rajneesh Kumar 2014-12-31 02:41:40 UTC
I have checked this issue and able to reproduce this. To reproduce this issue I have followed the the code and instruction provided in bug description.

Sample Application: https://www.dropbox.com/s/sn9elt8purzpkuc/Bug_25662.zip?dl=0
Note :Getting same behavior with Android and iOS.

Steps I followed:

1. Open attached test application in XS.
2. Set iOS as startup project.
3. Open App.cs file and observe under MySwitch class:
     "IsEnabled = false;"
3. Build application and deploy it on simulator.
4. Observed that  it has no effect - it is still interactive.

Screencast: http://www.screencast.com/t/XHQjMeJ7u4o3
Application Output: https://gist.github.com/Rajneesh360Logica/ceed2e596c7b91f2a381
Build output: https://gist.github.com/Rajneesh360Logica/0d52ef40d399c340a8ef
XS logs: http://www.screencast.com/t/HBgCAS7y

Additional information: I have checked this issue with EntryCell and observed that  "IsEnabled = false;" and  "IsEnabled = true;" working as expected.

Environment Info:
=== Xamarin Studio ===

Xamarin.forms Version: 1.2.3.6257

Version 5.5.4 (build 15)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.10.0 ((detached/92c4884)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000031

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/MM/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)
		3.2    (API level 13)
		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)

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.iOS ===

Version: 8.4.0.47 (Business Edition)
Hash: 7244769
Branch: 
Build date: 2014-12-11 14:54:30-0500

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Build Information ===

Release ID: 505040015
Git revision: f93940a35458a18052f1a25e106e62ca970d9c40
Build date: 2014-11-19 15:32:41-05
Xamarin addins: dc23cbd91a3a0e1d326328e1229e86c942a49ec8

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 2 glucose1e 2015-05-15 01:20:51 UTC
Hello? Anybody here? Almost half year passed and this obviously bug is still here?
Comment 3 Jason Smith [MSFT] 2015-05-19 15:11:27 UTC
We see it thank you
Comment 4 Rui Marinho 2015-05-20 09:45:16 UTC
Should be fixed in 1.4.3
Comment 5 Rajneesh Kumar 2015-05-22 14:34:04 UTC
I have checked this issue with Xamarin.Forms Version: 1.4.3.6358-pre2 and I am still observing same behaviour. 
Here is the screencast for the same: http://www.screencast.com/t/JmBwIMZUkC

It seems me that the issue has't fixed yet, hence I am reopening this issue.  Also please let me know if I am missing something to check this issue ?

Thanks..!

Environment Info:

=== Xamarin Studio ===

Version 5.9.2 (build 2)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 4.0.1 ((detached/11b5830)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400010043

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.Mac ===

Version: 2.0.0.262 (Indie Edition)

=== Xamarin.Android ===

Version: 5.1.2.1 (Indie Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		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 Android Player ===

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

=== Xamarin.iOS ===

Version: 8.11.0.751 (Trial Edition)
Hash: fda063c
Branch: master
Build date: 2015-05-11 15:28:05-0400

=== Build Information ===

Release ID: 509020002
Git revision: 43735a4b905b571f69cf9428a3ea7b52aef55476
Build date: 2015-05-18 09:38:12-04
Xamarin addins: ab18ddff45f507ed74f36c2b65df9aee22e28a56

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 6 Eric Maupin 2015-05-22 15:02:07 UTC
In the next 1.4.3 release, not what is currently available.
Comment 7 Parmendra Kumar 2015-06-22 10:37:41 UTC
I have checked this issue with xamarin.forms.1.4.3.6364-pre3 and its working fine on iOS but I am getting same behavior with Android.

Screencast: http://www.screencast.com/t/9jtG5tC1

Hence reopen this issue.

Environment: 
Xamarin Studio  5.9.3 (build 1)
Mono 4.0.1 ((detached/ed1d3ec)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400010044
Xcode 6.2 (6776)
Xamarin.iOS: 8.10.1.64 (Enterprise Edition)
Xamarin.Android: 5.1.3.1 (Enterprise Edition)
Xamarin.Mac: 2.0.1.64 (Enterprise Edition)
Mac OS X 10.9.4
Comment 8 glucose1e 2015-06-30 23:17:01 UTC
In the latest stable Xamarin.Forms.1.4.3.6372, the ios is working fine, but the bug still exist in Android.
The SwitchCell.IsEnabled = false seems useless in Android, not only in Listview, but also in TableView.
Comment 9 roger.schmidlin 2015-07-02 03:32:30 UTC
i am using the isVisible property and run into the same problem on iOS and on Android with Xamarin.Forms.1.4.3.6372. I read somewhere, that this is a bool updating problem with views. Very annoying!
Comment 10 Trevor 2015-08-13 16:50:24 UTC
I'm still seeing this bug on Android with Forms 1.4.4.
Comment 11 Ione Souza Junior 2015-09-22 08:16:56 UTC
I'm using Xamarin Forms 1.5.0.6446 and this behaviour still going on Android devices.
Comment 12 Ashley Gazich [MSFT] 2015-09-23 15:38:07 UTC
@Ione

Please provide the following information when you get a chance:

1. Full version info
Visual Studio: Help > About Microsoft Visual Studio > Copy Info [button]
Xamarin Studio > About Xamarin Studio > Show Details > Copy Information [button]

2. Sample project demonstrating the issue

3. Steps to reproduce

Thanks!
Comment 13 Ione Souza Junior 2015-09-23 20:33:39 UTC
Hi, 


1. Full version info

=== Xamarin Studio ===

Version 5.9.7 (build 9)
Installation UUID: bafbd163-4115-41f5-bf62-3eed667ecfa6
Runtime:
Mono 4.0.4 ((detached/cb6d6b2)
GTK+ 2.24.23 (Raleigh theme)

Package version: 400040002

=== Apple Developer Tools ===

Xcode 7.0 (8227)
Build 7A220

=== Xamarin.iOS ===

Version: 9.0.1.20 (Business Edition)
Hash: d8e9592
Branch: master
Build date: 2015-09-18 23:22:05-0400

=== Xamarin.Android ===

Version: 5.1.6.7 (Starter Edition)
Android SDK: /Users/desenvolvedor3/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3   (API level 10)
4.0.3 (API level 15)
4.4   (API level 19)
5.0   (API level 21)
5.1   (API level 22)
Java SDK: /usr
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

=== Xamarin Android Player ===

Not Installed

=== Xamarin.Mac ===

Version: 2.0.2.111 (Starter Edition)

=== Build Information ===

Release ID: 509070009
Git revision: 31fa64709030b3edb971237780a452a4c69943c4
Build date: 2015-09-17 11:44:37-04
Xamarin addins: b105d33d8cd72911ff2cf3ee0b7715d37e5f19a6

=== Operating System ===

Mac OS X 10.10.5
Darwin desenvolvedor3s-MacBook-Pro.local 14.5.0 Darwin Kernel Version 14.5.0
    Wed Jul 29 02:26:53 PDT 2015
    root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64




2. Sample project demonstrating the issue 
Download at http://www.prioriit.com/downloads/BlankProject.zip


3. Steps to reproduce
http://www.screencast.com/t/LgddSdJSu
Comment 14 om2804 2015-10-20 06:52:50 UTC
The same on only Android with Xamarin.Forms 1.5.0.6447.
iOS is normal. Fix it, please
Comment 15 Samantha Houts [MSFT] 2016-03-18 02:20:04 UTC
This should be fixed in 2.2.0-pre1.
Comment 16 Parmendra Kumar 2016-04-05 14:04:59 UTC
I have checked this issue with xamarin.forms 2.2.0-pre1 and I am using sample project provided in comment #13. I am still facing same issue with android. 

Screencast: http://www.screencast.com/t/9c40uRAAQYS9

Environment Info: https://gist.github.com/Parmendrak/b16beaa58782aba40a7ad5ec8a7aed9c


Hence reopen this issue.
Comment 17 Ione Souza Junior 2016-04-05 16:18:13 UTC
This bug has not yet been fixed. I tested in Xamarin.Forms 2.2.0.4-pre1 too.
Comment 18 Rui Marinho 2016-04-07 12:36:08 UTC
Should be fixed in 2.2.1-pre1
Comment 19 Rajneesh Kumar 2016-04-22 05:49:27 UTC
I have again checked this issue with Xamarin.Forms 2.2.0.23-pre4 with using sample project provided in comment #13. I am still facing same issue with android. 

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

Thanks.
Comment 20 Samantha Houts [MSFT] 2016-04-27 22:19:29 UTC
Sorry about that! This fix was bumped to 2.3.0-pre1. Please check with the updated package and let us know if it does not resolve your issue. Thanks!
Comment 21 reichelt 2016-11-17 10:26:13 UTC
I still get this behavior in Forms 2.3.2.127 for iOS and Android.
Fields are greyed out but still clickable and action is triggered.
Comment 22 Joel N. 2017-02-09 12:16:01 UTC
Getting same behavior in Xamarin.Forms 2.3.3.180 for Android. Greyed out but clickable.
Comment 23 E.Z. Hart [MSFT] 2017-07-14 22:45:08 UTC
This is still a problem on UWP Desktop; you can run the repro in Control Gallery for this case to see it happen. 

Note that tapping on the switch label or anywhere in the middle of the switch renderer has no effect - you have to tap the "switch" part of the control on the far right.
Comment 24 Jimmy [MSFT] 2017-07-18 22:54:06 UTC
Created attachment 23646 [details]
repro project

Testing with both 2.3.5-pre6 and 2.3.6.119-nightly, I cannot reproduce this issue on Android or iOS. But as mentioned in comment 23, the issue still exists on UWP. 

I've attached a repro project and am setting the report back to confirmed.
Comment 25 Samantha Houts [MSFT] 2017-11-16 19:31:06 UTC
https://github.com/xamarin/Xamarin.Forms/pull/1279
Comment 26 Rui Marinho 2017-12-05 17:16:38 UTC
Should be fixed on 2.6.0 for UWP