How could I do this with wpf instead of windows forms?
Here is a sample in WPF. And another blog with a different sample.