Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C] Prevent enabling a Button via setting a Command #308

Merged
merged 1 commit into from Sep 12, 2016

Conversation

@pauldipietro
Copy link
Member

commented Aug 16, 2016

Description of Change

When creating a Button it was possible to unintentionally re-enable it by either:

  • Setting IsEnabled before Command in the constructor/assignment sequence
  • Setting the Command value to null at another point in time (assuming the above did not occur)

A visual reproduction has been added to the issues.

Bugs Fixed

https://bugzilla.xamarin.com/show_bug.cgi?id=43354

API Changes

None

Behavioral Changes

None

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Consolidate commits as makes sense
@brianlagunas

This comment has been minimized.

Copy link

commented Aug 17, 2016

EDIT: Whoops misread what was happening here :)

@@ -168,7 +168,7 @@ protected override void OnPropertyChanging(string propertyName = null)
void CommandCanExecuteChanged(object sender, EventArgs eventArgs)
{
ICommand cmd = Command;
if (cmd != null)
if (cmd != null && (bool)GetValue(IsEnabledProperty))

This comment has been minimized.

Copy link
@StephaneDelcroix

StephaneDelcroix Aug 17, 2016

Member

why not using IsEnabled;

This comment has been minimized.

Copy link
@pauldipietro

pauldipietro Aug 17, 2016

Author Member

Probably no reason not to so I'll change it

@pauldipietro pauldipietro force-pushed the fix-bugzilla43354 branch from a7ca96a to e25ca2f Aug 17, 2016

@samhouts

This comment has been minimized.

Copy link
Member

commented Sep 6, 2016

👍 Needs rebase

@pauldipietro pauldipietro force-pushed the fix-bugzilla43354 branch from e25ca2f to 2571938 Sep 6, 2016

@pauldipietro

This comment has been minimized.

Copy link
Member Author

commented Sep 6, 2016

Rebased

@rmarinho

This comment has been minimized.

Copy link
Member

commented Sep 12, 2016

👍

@rmarinho

This comment has been minimized.

Copy link
Member

commented Sep 12, 2016

Green tests

@rmarinho rmarinho merged commit 368a375 into master Sep 12, 2016

@rmarinho rmarinho deleted the fix-bugzilla43354 branch Sep 12, 2016

rmarinho added a commit that referenced this pull request Sep 13, 2016

@samhouts samhouts added this to the 2.3.3 milestone Jun 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.