Since you are using Wpf, I made a quick working example. Make sure your project links look like this.

Mainwindow
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using System.Windows.Forms; namespace WpfApplication1 {
And as indicated, it would be easier if you could use Wpf Dispatcher Timer. IN, looking at an example link, there is no need to use the Windows Form Timer, the dispatcher timer will work fine in this case, since it is a WPF program.
Edit Modified based on your link
public partial class MainWindow : Window { System.Windows.Threading.DispatcherTimer tmrStart = new System.Windows.Threading.DispatcherTimer(); System.Windows.Threading.DispatcherTimer tmrStop = new System.Windows.Threading.DispatcherTimer(); public MainWindow() { InitializeComponent(); tmrStart.Interval = TimeSpan.FromSeconds(2);
source share