diff options
3 files changed, 3 insertions, 58 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43354.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43354.cs deleted file mode 100644 index 6ed77b96..00000000 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43354.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; - -using Xamarin.Forms.CustomAttributes; -using Xamarin.Forms.Internals; - -#if UITEST -using Xamarin.UITest; -using NUnit.Framework; -#endif - -namespace Xamarin.Forms.Controls.Issues -{ - [Preserve(AllMembers = true)] - [Issue(IssueTracker.Bugzilla, 43354, "Button command being set after IsEnabled enables the button", PlatformAffected.All)] - public class Bugzilla43354 : TestContentPage - { - protected override void Init() - { - var buttonIsEnabledSetFirst = new Button - { - Text = "Click to display an alert", - IsEnabled = false, - Command = new Command(() => DisplayAlert("Test", "Message", "Cancel")), - }; - - var buttonIsEnabledSetSecond = new Button - { - Text = "Click to enable/disable button", - Command = new Command(() => - { - if (buttonIsEnabledSetFirst.IsEnabled) - buttonIsEnabledSetFirst.IsEnabled = false; - else - buttonIsEnabledSetFirst.IsEnabled = true; - }) - }; - - var buttonSetCommandToNull = new Button - { - Text = "Click to set first button's command to null", - Command = new Command(() => buttonIsEnabledSetFirst.Command = null) - }; - - Content = Content = new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Children = - { - buttonIsEnabledSetFirst, - buttonIsEnabledSetSecond, - buttonSetCommandToNull - } - }; - } - } -} 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 1e0a2732..adf173df 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 @@ -124,7 +124,6 @@ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla42364.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla42519.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla43516.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Bugzilla43354.cs" /> <Compile Include="$(MSBuildThisFileDirectory)CarouselAsync.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla34561.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla34727.cs" /> diff --git a/Xamarin.Forms.Core/Button.cs b/Xamarin.Forms.Core/Button.cs index a4dffc78..31573076 100644 --- a/Xamarin.Forms.Core/Button.cs +++ b/Xamarin.Forms.Core/Button.cs @@ -180,7 +180,7 @@ namespace Xamarin.Forms void CommandCanExecuteChanged(object sender, EventArgs eventArgs) { ICommand cmd = Command; - if (cmd != null && IsEnabled) + if (cmd != null) IsEnabledCore = cmd.CanExecute(CommandParameter); } @@ -225,6 +225,8 @@ namespace Xamarin.Forms Command.CanExecuteChanged += CommandCanExecuteChanged; CommandCanExecuteChanged(this, EventArgs.Empty); } + else + IsEnabledCore = true; } void OnSourceChanged(object sender, EventArgs eventArgs) |