I'm trying to test a class that uses CommandManager.RequerySuggested
and noticed that calling CommandManager.InvalidateRequerySuggested
does not fire RequerySuggested
from my test. Is there a reason for this and how to I resolve this issue? Does the CommandManager
require some initialization?
Code to reproduce the issue:
[Test]
public void InvalidateRequerySuggested_TriggersRequerySuggested()
{
bool triggered = false;
CommandManager.RequerySuggested += (s, a) => triggered = true;
CommandManager.InvalidateRequerySuggested();
Thread.Sleep(1000); // Just to be sure
Assert.True(triggered); // Never true
}