Bug 22310 - Bug with Switch control on Windows Phone 8
Summary: Bug with Switch control on Windows Phone 8
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.2
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-08-22 14:21 UTC by Kevin.Murray
Modified: 2014-09-22 13:31 UTC (History)
5 users (show)

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

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 Kevin.Murray 2014-08-22 14:21:03 UTC
The Switch control does not honor the IsEnabled property.  You can set it to false, but the control still functions.
Comment 1 Seth Rosetter 2014-08-27 13:35:04 UTC
Kevin, 

Can you provide more context? I am unable to reproduce with this information. The failing code / project along with information of your development environment would be very helpful.
Comment 2 Kevin.Murray 2014-08-27 15:21:24 UTC
Using Visual Studio 2013, Update 3.

In my XAML I have a StackLayout, in which is another Stack Layout containing the Switch:

<StackLayout>

        <StackLayout Orientation="Horizontal" HorizontalOptions="Center" >
            <Label Text="Login without User Name" YAlign="Center"/>
            <Switch x:Name="chkAnon" Toggled="Anynonmous_Toggled" />
        </StackLayout>

        <Entry x:Name="eUser" Placeholder="User Name" />
        <Entry x:Name="ePass" Placeholder="Password" IsPassword="true" />
        <StackLayout Orientation="Horizontal" HorizontalOptions="Center" >
            <Label x:Name="lblSave" Text="Save User Name and Password" YAlign="Center"/>
            <Switch x:Name="chkSave" />
        </StackLayout>

</StackLayout>


That's minus all the other controls, of course. So, when the user toggles the first switch, chkAnon, in the event handler, I do the following:


        public void Anynonmous_Toggled( Object sender, EventArgs e )
        {
            eUser.IsEnabled = !chkAnon.IsToggled;
            ePass.IsEnabled = !chkAnon.IsToggled;
            chkSave.IsEnabled = !chkAnon.IsToggled;
        }

The two entry fields disable, the chkSave switch does not...
Comment 3 Seth Rosetter 2014-08-28 14:08:35 UTC
I have confirmed this. Thanks you for the extra information.
Comment 4 Eric Maupin 2014-09-22 13:31:01 UTC
Fixed in 1.2.3-pre3.