c# - How to call this method in a background worker? -


i beginner in c# , wpf , building project in have trigger when mouse moved. under conditions, have use background worker. want call mouse_moved method in background, don't know how . can me please? code far:

public mainwindow()  {    initializecomponent();     mouse = new mouseinput();    mouse.mousemoved += mouse_mousemoved;  } void mouse_mousemoved(object sender, eventargs e) {     //the code need }   private void worker_dowork(object sender, doworkeventargs e) {    //where want call mouse_moved method } 

create method , call both:

void mouse_mousemoved(object sender, eventargs e) {     domousemovedwork(); }  private void worker_dowork(object sender, doworkeventargs e) {     domousemovedwork(); }  private domousemovedwork() {     //the code need } 

Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -