2018-03-01 08:06:28 +08:00
|
|
|
## ICommand.CanExecuteChanged event behaviour changed in .NET Framework 4.5
|
2017-04-06 04:52:19 +08:00
|
|
|
|
|
|
|
### Scope
|
|
|
|
Minor
|
|
|
|
|
|
|
|
### Version Introduced
|
|
|
|
4.5
|
|
|
|
|
|
|
|
### Version Reverted
|
|
|
|
4.5
|
|
|
|
|
|
|
|
### Source Analyzer Status
|
|
|
|
Planned
|
|
|
|
|
|
|
|
### Change Description
|
2017-04-21 02:19:05 +08:00
|
|
|
|
|
|
|
In the .NET Framework 4.5, a
|
|
|
|
<xref:System.Windows.Input.ICommand.CanExecuteChanged?displayProperty=name> was
|
|
|
|
ignored unless the sender of the event was the same object as the object that
|
2017-08-24 03:57:22 +08:00
|
|
|
raised the event. This bug was fixed in .NET Framework 4.5 servicing updates.
|
2017-04-06 04:52:19 +08:00
|
|
|
|
|
|
|
- [ ] Quirked
|
|
|
|
- [ ] Build-time break
|
|
|
|
|
|
|
|
### Recommended Action
|
2017-04-21 02:19:05 +08:00
|
|
|
|
|
|
|
This bug has been fixed in the .NET Framework 4.5 servicing releases, so it can
|
|
|
|
be avoided by making sure that the .NET Framework is up-to-date or by upgrading
|
|
|
|
to .NET Framework 4.5.1. Alternatively, application code using
|
|
|
|
<xref:System.Windows.Input.ICommand?displayProperty=name> can be modified to
|
|
|
|
make sure that the sender when raising a
|
|
|
|
<xref:System.Windows.Input.ICommand.CanExecuteChanged?displayProperty=name>
|
|
|
|
command is the same as the object raising the event.
|
2017-04-06 04:52:19 +08:00
|
|
|
|
|
|
|
### Affected APIs
|
|
|
|
* `E:System.Windows.Input.ICommand.CanExecuteChanged`
|
|
|
|
|
|
|
|
### Category
|
|
|
|
Windows Presentation Foundation (WPF)
|
|
|
|
|
|
|
|
[More information](http://connect.microsoft.com/VisualStudio/feedback/details/751429/wpf-icommand-canexecutechanged-behaviour-change-in-net-4-5)
|
2017-04-18 07:52:04 +08:00
|
|
|
|
|
|
|
<!-- breaking change id: 84 -->
|