Click here to Skip to main content
15,919,500 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Floating control at the bottom of the web page?? Pin
Mark Salsbery29-Jun-09 9:25
Mark Salsbery29-Jun-09 9:25 
GeneralRe: Floating control at the bottom of the web page?? Pin
Sunil P V30-Jun-09 5:53
Sunil P V30-Jun-09 5:53 
GeneralRe: Floating control at the bottom of the web page?? Pin
Mark Salsbery30-Jun-09 7:08
Mark Salsbery30-Jun-09 7:08 
GeneralRe: Floating control at the bottom of the web page?? Pin
Sunil P V30-Jun-09 22:15
Sunil P V30-Jun-09 22:15 
QuestionProgressBar Pin
Ranger4929-Jun-09 7:33
Ranger4929-Jun-09 7:33 
AnswerRe: ProgressBar [modified] Pin
Mark Salsbery29-Jun-09 9:00
Mark Salsbery29-Jun-09 9:00 
GeneralRe: ProgressBar [modified] Pin
Ranger4929-Jun-09 9:33
Ranger4929-Jun-09 9:33 
GeneralRe: ProgressBar Pin
Mark Salsbery29-Jun-09 10:00
Mark Salsbery29-Jun-09 10:00 
Ranger49 wrote:
should the code to compute the fractal be put in the DoWork method, where the progressbar is in the ProgressChanged method?


Yes.

My example was over-simplified, and putting the code to create the
lines in the ProgressChaged event handler was out of necessity. I did that
because creating lines in the BackgroundWorker thread throws an exception
because the BackroundWorker thread is an MTA model thread and creating WPF elements
needs to be on a STA model thread. Additionally, even if you create the lines in
a STA thread, you can't add them to the canvas because you can only access UI elements
on the UI thread, and a line created on a background thread can't be added to a
canvas created on the UI thread. Catch-22?

Anyway, you'd want to do as much of the calculation as you can on the background thread
(i.e. in the DoWork handler) and you have to do the UI stuff on the UI thread (the
BackgroundWorker.ProgressChanged event occurs on the UI thread).

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: ProgressBar Pin
Ranger4929-Jun-09 10:15
Ranger4929-Jun-09 10:15 
GeneralRe: ProgressBar Pin
Pete O'Hanlon29-Jun-09 10:05
mvePete O'Hanlon29-Jun-09 10:05 
GeneralRe: ProgressBar [modified] Pin
Mark Salsbery29-Jun-09 10:16
Mark Salsbery29-Jun-09 10:16 
GeneralRe: ProgressBar Pin
Ranger4929-Jun-09 10:26
Ranger4929-Jun-09 10:26 
QuestionManually firing WPF RoutedCommand Pin
DahrkDaiz29-Jun-09 5:16
DahrkDaiz29-Jun-09 5:16 
AnswerRe: Manually firing WPF RoutedCommand Pin
Pete O'Hanlon29-Jun-09 6:06
mvePete O'Hanlon29-Jun-09 6:06 
AnswerRe: Manually firing WPF RoutedCommand Pin
User 27100929-Jun-09 15:48
User 27100929-Jun-09 15:48 
QuestionMessage Removed Pin
29-Jun-09 4:54
professionalN_tro_P29-Jun-09 4:54 
AnswerRe: Images and Namespaces Pin
Gideon Engelberth29-Jun-09 6:29
Gideon Engelberth29-Jun-09 6:29 
QuestionWPF custom control Pin
Vinod C S29-Jun-09 4:21
Vinod C S29-Jun-09 4:21 
AnswerRe: WPF custom control Pin
Christian Graus29-Jun-09 11:13
protectorChristian Graus29-Jun-09 11:13 
GeneralRe: WPF custom control Pin
Vinod C S29-Jun-09 19:42
Vinod C S29-Jun-09 19:42 
QuestionEliminating The standard shape of a bitmap(actually xaml based) button, How to :)? Pin
cppwxwidgetsss29-Jun-09 1:12
cppwxwidgetsss29-Jun-09 1:12 
AnswerRe: Eliminating The standard shape of a bitmap(actually xaml based) button, How to :)? Pin
Mark Salsbery29-Jun-09 6:41
Mark Salsbery29-Jun-09 6:41 
QuestionHow can I use Application Idle Event in WPF? Pin
Kunal Chowdhury «IN»28-Jun-09 23:00
professionalKunal Chowdhury «IN»28-Jun-09 23:00 
AnswerRe: How can I use Application Idle Event in WPF? Pin
Christian Graus28-Jun-09 23:32
protectorChristian Graus28-Jun-09 23:32 
GeneralRe: How can I use Application Idle Event in WPF? Pin
Kunal Chowdhury «IN»29-Jun-09 2:15
professionalKunal Chowdhury «IN»29-Jun-09 2:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.