![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | thread safe call to button_click Hi, I want to make a thread safe call to a button click method. I am using: private delegate void BindDelegateLogout(object sender, EventArgs e); BindDelegateLogout delL; delL = new BindDelegateLogout(this.btnClickLogout); Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, delL, this); But in this Dipatcher.Invoke I need to give 2 arguments, my object and my EventArge. How do I provide my button click method with these arguments? I tried: Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, delL, null, new Object[] {this, new EventArgs()); but that won't do the trick. Thanks, Bart |
My System Specs![]() |
| | #2 (permalink) |
| Guest | RE: thread safe call to button_click "Bart van der Heijden" wrote: > Hi, > > I want to make a thread safe call to a button click method. > > I am using: > > private delegate void BindDelegateLogout(object sender, EventArgs e); > BindDelegateLogout delL; > delL = new BindDelegateLogout(this.btnClickLogout); > Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, delL, > this); > > But in this Dipatcher.Invoke I need to give 2 arguments, my object and my > EventArge. How do I provide my button click method with these arguments? > > I tried: > > Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, delL, > null, new Object[] {this, new EventArgs()); but that won't do the trick. > > Thanks, > > Bart > > Solved it: Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, delL, this, new Object[] { new EventArgs()); so the argument "arg" should be "this" and the argument "arguments[]" should be the rest of the arguments, namely "new Object[] {new EventArgs()} |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Start a new thread from an existing thread, which was started from atimer | Curious | .NET General | 1 | 06-13-2008 01:36 PM |
| Call function with parameters that also call functions (.Net and P | bsdz | PowerShell | 2 | 06-10-2008 05:31 AM |
| Are Activator/Remoting Proxies Thread-Safe? | Jules Winfield | .NET General | 2 | 04-07-2008 01:23 AM |
| No replies to my Call of Duty 4 problem thread question... | VelociT | Gaming | 0 | 12-13-2007 08:46 PM |
| Is there a thread with Call of Duty 4 issues with Vista x64? | VelociT | Gaming | 0 | 12-12-2007 02:13 PM |