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();