Closed xiaosu-zhu closed 6 years ago
CustomVisualizer is based on SwapPanel but not CanvasAnimatedControl, there indeed is no way to pause the draw loop, however you can set the property of IsSuspended property on VisualizationSource to suspend processing. You can also figure out if the source is rendering audio from the VisualizationSource PlaybackState property. This will not stop draw loop however you can look at these properties and do nothing in the draw event handler
Got it. I didn't look deep in the code, I will use these tricks to pause drawing.
Looks like
CustomVisualizer
is a Win2D UIElementCanvasAnimatedControl
, but inCanvasAnimatedControl
, it has many properties and methods and events thatCustomVisualizer
doesn't.Such as
CanvasAnimatedControl.Paused
that can pause the drawing loop and many others in CanvasAnimatedControl ClassAlso, memory leaks in
CanvasAnimatedControl
may also occur inCustomVisualizer
, please see Avoiding memory leaks