This recipe has a background thread acting like an analog signal generator that is able to generate a sine-style stream of data and a graph that plots this data. The resulting application is as follows:
You can adjust the resolution of the plot (number of points used to draw the sine) using the track bar on the left-hand side. Let's see the most important parts.
The thread used as a signal generator is very simple. As shown in the following code, it uses the System.Math.Sin function to generate a sine wave form. Roughly every 10 milliseconds, ...