Home All Groups Group Topic Archive Search About
Author
8 May 2007 3:08 PM
Romain TAILLANDIER
Hi group,

I m new to Winfx.
I have created a new project using XAML. it have create a ne class
inherited from System.Windows.Windows, great.
Now i am used to use delegate and calling the invoke Method of classic
winform. What is now the equivalent of that ?

public class MyClass : System.Windows.Form
{
    public EventHAndler MyMethodHandler;
....
    public void caller()
    {
       this.Invoke(MyMethodHandler,new object[2]{null,null});
    }

   public void MyMethod(object sender, EventArgs e)
   {
      // DO SOMETHING ASYNC
   }
}

In my case i have a simple serial port, and i want to print in a list
box some data. The event DataReceived of the port is listenned, and
call another method by invoking it which show up data in a listbox.

thank you !

AddThis Social Bookmark Button