public MainWindow() { InitializeComponent(); CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering); Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing); _sensor = new NuiSensor("SamplesConfig.xml"); _worker.DoWork += new DoWorkEventHandler(Worker_DoWork); }