I'm developing some form which I would like to reuse in other application and get good experience. This form contains progress bar and label. By other side I have asynchronous process. I want to bound this stuff and get universal form, which can be notified about changes in some asynchronous process. Is observer good for this purpose, guys?
Asked
Active
Viewed 220 times
0
-
_I want to bound this stuff and get universal form_, please elaborate. What specifically do you want to _bound_? – M.Babcock Mar 03 '12 at 03:54
-
I want to bound form (it's a simple form with just progress bar and label) and this asynchronous process. – kseen Mar 03 '12 at 03:59
-
That is really my question. Do you want your form's events to fire on the asynchronous thread? Perhaps I'm alone, but I'm having trouble figuring out what you actually want to accomplish here. – M.Babcock Mar 03 '12 at 04:16
-
Sorry for my english. I just want to make reusable form, that I could use in future and I don't know how to do it right way. Yes, I want that async process fire form's events. – kseen Mar 03 '12 at 04:20
-
the report progress bar is only a UI component that gets updated when you change a property. It has no special feature regardin processes or threading. In that regard it's the same as outputing "10% complete" in the console. So I guess what you're asking is how the async process fires the event to the form. see http://stackoverflow.com/questions/2022063/fire-event-from-async-component-in-ui-thread – edeboursetty Mar 03 '12 at 04:52
1 Answers
0
Doesn't background worker have an event "onCompletionChange" (or similar)?
You can link that event to a main thread function, as long as you're using BackgroundWorker.
Otherwise, here is an example (1st link) from a google search for:
"C# async progress".
-
I already have implementation of async process. And it's not a backgroundworker. I just want to chose right way to make reusable form, which may be used in many apps, notifying about some progress in an app. – kseen Mar 03 '12 at 04:00