![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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 | Re: A Question on BackgroundWorker. Is there any solution for this problem? "Lei Jiang" <code@263.net.NO_SPAM> schrieb im Newsbeitrag news:%231ITs%23K7FHA.3048@TK2MSFTNGP10.phx.gbl... > > Thanks! Is there any other method that could solve my problem in my first > post? > > Thanks! > > > "Nick Kramer [MSFT]" <nkramer@ms.spam> дÈëÏûÏ¢ > news:OOKAS6K7FHA.2628@TK2MSFTNGP11.phx.gbl... >> To answer your original question, there's no way in WPF to great >> UIElements on one thread and send them to another. Freezable was >> specifically designed to be shared across the threads. Other subclasses >> of DispatcherObject are not, therefore they can't be shared across >> threads. From a platform point of view, being shared between threads and >> being created on one thread then handed off to another are nearly >> indistinguishable, so we don't distinguish. >> >> -Nick Kramer [MSFT] >> http://blogs.msdn.com/nickkramer >> >> --- >> This posting is provided "AS IS" with no warranties, and confers no >> rights. Use of included script samples are subject to the terms specified >> at http://www.microsoft.com/info/cpyright.htm >> >> >> "Lei Jiang" <code@263.net.NO_SPAM> wrote in message >> news:%23v8y8QB7FHA.1028@TK2MSFTNGP11.phx.gbl... >>> >>> As described in that thread, DispatcherObject.DetachFromDispatcher is >>> what needed in such situation, why this method is dropped? >>> >>> Thanks! >>> >>> "Lei Jiang" <code@263.net.NO_SPAM> дÈëÏûÏ¢ >>> news:etj8IOB7FHA.3136@TK2MSFTNGP09.phx.gbl... >>>> >>>> Thanks! I have read that thread, but it only works for Freezable. Other >>>> objects, such as Shapes, Canvas, cannot go through thread boundary. >>>> >>>> "Drew Marsh" <drub0y@hotmail.no.spamming.com> ???? >>>> news:b6983b4cc64cb8c7b9fd613d70c8@msnews.microsoft.com... >>>>> Lei Jiang wrote: >>>>> >>>>>> If I want to create new WPF objects in background thread and add them >>>>>> to main UI, how could I do it? For example, I have some data stored >>>>>> in >>>>>> database and want to load them in a background thread, then create >>>>>> WPF >>>>>> objects and add them into the main UI. If I do this, an >>>>>> ArgumentException will be thrown : "This API was accessed with >>>>>> arguments from the wrong context.". This exception is thrown as >>>>>> expected since this situation is forbidden and is clearly stated in >>>>>> document. The question is : how can I do such tasks? The data should >>>>>> be loaded in a background thread and only after the data are loaded >>>>>> could the WPF objects be created, and the UI thread is the main >>>>>> thread. How can I create the UI without long UI delay? >>>>> >>>>> While there used to be a way to do this, it no longer exists. Some of >>>>> the details in this[1] thread might be able to help you. >>>>> >>>>> HTH, >>>>> Drew >>>>> >>>>> [1] >>>>> http://msdn.microsoft.com/newsgroups...f-899706aae7bc >>>>> ___________________________________ >>>>> Drew Marsh >>>>> Chief Software Architect >>>>> Mimeo.com, Inc. - http://www.mimeo.com >>>>> Weblog - http://blog.hackedbrain.com/ >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| BackgroundWorker? | Ramping up... | PowerShell | 2 | 07-07-2008 07:41 AM |
| question: | jonathan perreault | Vista mail | 4 | 09-18-2007 09:42 PM |
| SP1 Question | TH | Vista General | 7 | 04-20-2007 03:04 PM |
| vista genral question and ultimate question | pedro g | Vista General | 7 | 02-09-2007 10:34 PM |
| Dual boot system question and family deal discount question | Betatesterzz | Vista General | 2 | 01-31-2007 08:25 AM |