DispatcherTimer priority
Hello, I have a very large application, and the animation of the spectrum analyzer laggs because the priority of the dispatcher timer is only ApplicationIdle. If I change it to Render via Reflection it's smooth again.
Can you make this configurable without using reflection?
Current workaround:
` var spectrumAnalyzerType = spectrumAnalyzer.GetType(); var dispatcherTimer = new DispatcherTimer(DispatcherPriority.Render) {Interval = TimeSpan.FromMilliseconds(spectrumAnalyzer.RefreshInterval)}; var animationTimerField = spectrumAnalyzerType.GetField("animationTimer", BindingFlags.Instance | BindingFlags.NonPublic); var tickMethodInfo = spectrumAnalyzerType.GetMethod("animationTimer_Tick", BindingFlags.Instance | BindingFlags.NonPublic); var tickEventInfo = typeof(DispatcherTimer).GetEvent("Tick");
animationTimerField.SetValue(spectrumAnalyzer, dispatcherTimer);
var handler = Delegate.CreateDelegate(tickEventInfo.EventHandlerType, spectrumAnalyzer, tickMethodInfo);
tickEventInfo.AddEventHandler(dispatcherTimer, handler);
spectrumAnalyzer.RegisterSoundPlayer(...);`