Skip to content

Fixed CI failure : Restore BackButtonBehavior IsEnabled after CanExecute changes#34668

Merged
kubaflo merged 1 commit intodotnet:inflight/candidatefrom
Shalini-Ashokan:BackButton-failures-candidate
Mar 26, 2026
Merged

Fixed CI failure : Restore BackButtonBehavior IsEnabled after CanExecute changes#34668
kubaflo merged 1 commit intodotnet:inflight/candidatefrom
Shalini-Ashokan:BackButton-failures-candidate

Conversation

@Shalini-Ashokan
Copy link
Contributor

@Shalini-Ashokan Shalini-Ashokan commented Mar 26, 2026

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue details

This PR #28734 causes the unit test below

  1. BackButtonUpdatesWhenSetToNewCommand
  2. BackButtonDisabledWhenCommandDisabled

Description of Change

The root cause is IsEnabledCore { set => SetValue(IsEnabledProperty, value && IsEnabled); } — a circular read: once IsEnabledProperty is false, reading IsEnabled always returns false, so the property is permanently stuck.

The fix introduces two backing fields to track the concerns independently:

  • _userDefinedIsEnabled — written only by the developer via IsEnabled

  • _commandEnabled — written only by CanExecute via IsEnabledCore

  • IsEnabledProperty is always _userDefinedIsEnabled && _commandEnabled, eliminating the circular read.

  • BackButtonDisabledWhenCommandDisabled — When CanExecute flips to true and ChangeCanExecute() is called, _commandEnabled updates correctly and the back button re-enables.

  • BackButtonUpdatesWhenSetToNewCommand — Setting Command = null resets _commandEnabled = true, so the back button re-enables as expected.

Test fixed

Unit tests:
BackButtonUpdatesWhenSetToNewCommand
BackButtonDisabledWhenCommandDisabled

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Mar 26, 2026
@dotnet-policy-service
Copy link
Contributor

Hey there @@Shalini-Ashokan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Mar 26, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review March 26, 2026 13:06
@sheiksyedm
Copy link
Contributor

@kubaflo Your PR #28734 causes the below unit test failure. Can you review whether this fix looks good to merge?

BackButtonUpdatesWhenSetToNewCommand
BackButtonDisabledWhenCommandDisabled

@kubaflo kubaflo merged commit fabae3b into dotnet:inflight/candidate Mar 26, 2026
5 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants