
Untitled
By: a guest on
May 11th, 2012 | syntax:
None | size: 0.52 KB | hits: 13 | expires: Never
Threading in WPF [closed]
private void do_my_method_click(object sender, RoutedEventArgs e)
{
//there are some variables and methods here
//works fine
ThreadPool.QueueUserWorkItem(Start_method);
// when added gives error this thread owned by other thread
ThreadPool.QueueUserWorkItem(Start_method_2);
}
Start_method(object state)
{
}
Start_method_2(object state)
{
}
var sync = System.Threading.SynchronizationContext.Current;
sync.Post(x => {
TextBlock1.Text = "Foo";
}, null);