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

Alt+F4 calls WizardPageViewModelBase.CancelAsync #330

Open
2 of 6 tasks
lipchev opened this issue Jan 4, 2021 · 4 comments
Open
2 of 6 tasks

Alt+F4 calls WizardPageViewModelBase.CancelAsync #330

lipchev opened this issue Jan 4, 2021 · 4 comments

Comments

@lipchev
Copy link

lipchev commented Jan 4, 2021

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • WPF
  • UWP
  • iOS
  • Android
  • .NET Standard
  • .NET Core

Component

WizardWindow / WizardViewModel

Version of Library

4.2.0 / 4.3.0

Version of OS(s) listed above with issue

win10

Steps to Reproduce

  1. Override the CancelAsync method on any WizardPageViewModel (e.g. SkillsPageViewModel)
  2. Navigate to the target page and press Alt + F4

Expected Behavior

The behavior is identical to the one used for the CancelCommand- that is the WizardPageViewModel.CancelAsync is only called after the user confirms the cancellation (by default).

Actual Behavior

The CancelAsync on the WizardPageViewModel is called before the confirmation dialog is displayed (from the respective CancelAsync method on the WizardViewModel).

@lipchev
Copy link
Author

lipchev commented Jan 4, 2021

The problem is that the CancelViewModelAync initiated by the DiscardChangesAsync method on the DataWindow triggers the CancelingAsync event, to which the child view model responds first, before returning to the top level CancelAsync method (where the confirmation code lies).

The quick-and-dirty solution I came up with is to override the DiscardChangesAsync on my (custom) WizardWindow, executing the CancelCommand instead of directly calling the CancelViewModelAsync method

@GeertvanHorrik
Copy link
Member

Great find. We should indeed fix this in the WizardWindow. Interested in a PR?

@lipchev
Copy link
Author

lipchev commented Jan 5, 2021

Sure, I'll look into it..

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants