Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

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.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Re: A Question on BackgroundWorker.

Closed Thread
 
Thread Tools Display Modes
Old 01-10-2006   #1 (permalink)
Daniel Danilin's Avatar
Daniel Danilin
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/
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



Closed Thread

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








Vistax64.com 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 2005-2008

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 47 48 49 50