1

I want to test my project performance without using CommandManager RequerySuggested. I use the following codes to disable CommandManager from firing RequerySuggested Event. It removes all event handlers from RequerySuggested Event. Is there any other simpler way to achieve this.

List<WeakReference> fi = typeof(CommandManager).GetField("_requerySuggestedHandlers", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(typeof(CommandManager).GetField("_commandManager", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static).GetValue(null)) as List<WeakReference>;

fi.Clear();
hamid toosi
  • 95
  • 1
  • 10
  • Are you using RelayCommand class or DelegateCommand class or any other Command class? – S2S2 Jan 09 '12 at 12:05
  • Pls see if this discussion is useful for you: http://social.msdn.microsoft.com/Forums/en/wpf/thread/70de3275-a4f7-4a58-b612-a2b3df941327 – S2S2 Jan 11 '12 at 08:15

0 Answers0