Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Re: A Question on BackgroundWorker.

 
 
Old 01-10-2006   #1 (permalink)
Daniel Danilin


 
 

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/
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>




My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
How do I wait for a BackgroundWorker to finish? .NET General
escape character question - hopefully an easy question PowerShell
BackgroundWorker? PowerShell
vista genral question and ultimate question Vista General
Dual boot system question and family deal discount question Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46