I've determined that the following line of code works, in the sense that it eliminates the cross-thread access violation.

let f = new MethodInvoker(fun () -> this.Refresh()) in this.controller.Repaint.Add(fun () -> this.BeginInvoke(f) |> ignore)

Unfortunately, it also destroys the responsiveness of the GUI. When calling Refresh behind the thread's back, I can get a smooth 45 frames per second of updates, with live resizing; when using BeginInvoke, the animation frequently stutters, and I usually lose the ability to resize the window or click in the close box.

Will I have to do something verbose and sophisticated?

By on 12/24/2006 10:54 AM ()

Is there anything more... I don't know... <i>poignant<i> than one of those threads where a person answers their own question? I wanted Control.Invalidate, not Control.Refresh. This enables me to get in and get out quickly in the GUI thread, and the control repaints itself at will. Any other comments are, of course, very much welcome.

By on 12/24/2006 1:02 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper