I am working in wpf application. i want to call the print method till when i click stop button. So that case i have used in thread concept while i was getting This error 'The calling thread cannot access this object because a different thread owns it' because also multiple thread run in that method so i handled this type of solution. my print method called in PrintElement like this;

public static PrintLable PrintElement()
    PrintLable printLable= null;
       System.Windows.Threading.DispatcherPriority.Normal, new Action(
              PrintElement printLable = new PrintElement();
              // Initialize your PrintElement here
    return printLable;


Related Posts Plugin for WordPress, Blogger...