Monthly Archives: April 2012

Invoking WPF Control for Thread-Safe Call

if(!timerBox.CheckAccess()) {                   Dispatcher.Invoke(                                                                             DispatcherPriority.Send,(Action)delegate {    //********Your Code goes Here*********                   });                                                                                                                                                                         } ////////////////////////////////////////////////////////// //********* this mathod does not need new Thread ******** Main_grid.Dispatcher.Invoke(                                               DispatcherPriority.Background, new Action(() =>{  Main_grid.Children.Add(el);                                                                                                            }));  

Posted in Snippets, Wpf | Leave a comment