Once .NET 4.5 has been installed the view will no longer update when the AbstractCommandControl EnabledCondition changes. This is because the CanExecuteChanged event is invoked with the condition class passed in the "sender" parameter rather than passing the AbstractCommandControl control. It would appear that this is a bug fix in .NET 4.5 and WPF now expects the "sender" parameter to contain the ICommand it is bound to although I have yet to find any documentation for it.

To resolve the issue the OnEnableConditionChanged method of AbstractCommandControl should be modified from:

    private void OnEnableConditionChanged(object sender, EventArgs e)
        CanExecuteChanged(sender, e);


    private void OnEnableConditionChanged(object sender, EventArgs e)
        CanExecuteChanged(this, new EventArgs());

asked 28 Jun '12, 19:05

Kieron's gravatar image

accept rate: 0%

edited 29 Jun '12, 12:16

Scott%20Whitlock's gravatar image

Scott Whitlock ♦♦

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 28 Jun '12, 19:05

Seen: 1,579 times

Last updated: 08 May '13, 00:03

powered by OSQA