|
The chances are you would be better off asking the article author directly.
If you got the code from an article, then there is a "new message" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.
Posting this here relies on them "dropping by" and realising it is for them.
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
he is not replying that's y i put question here. i really need help
|
|
|
|
|
I am trying to update my programming paradigm into the 21st century and learn some of the more recent design patterns, including WPF. So far I like what I see but it is not obvious how I accomplish something similar to the background worker threading model by dragging a control in the designer.
I can set up some threads to accomplish decoupling the UI from the worker process but it was nice to have this functionality in the designer where I could just drag a control onto the form and attach a few event handlers.
Is there a counterpart to the background worker control in WPF?
|
|
|
|
|
BackgroundWorker works well in WPF applications. But I am not sure that you can drag and drop it like you do in windows forms. BackgroundWorker uses SynchronizationContext for cross thread communications. So in WPF, it uses DispatcherSynchronizationContext[^] which is a derived type of SynchronizationContext .
To be honestly, I never found BW to be so useful. I always used to spawn my own threads or use a pooled one.
Best wishes,
Navaneeth
|
|
|
|
|
I usually have very simple requirements for windows based utilities. Thank you for the link.
|
|
|
|
|
You can use the BackgroundWorker in WPF - the control just wraps the BackgroundWorker class - all you need do is manually create the BackgroundWorker in your code. To be honest though, I normally use the SmartThreadPool[^] instead - it's a fantastic piece of code.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Pete O'Hanlon wrote: it's a fantastic piece of code
Just followed your link and looked at the article. If the code is half as good, it's very good.
Thanks for the link. Now I'm off to play.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|
|
Pete O'Hanlon wrote: To be honest though, I normally use the SmartThreadPool[^] instead - it's a fantastic piece of code.
No doubt it's a great piece of code and it served me well in many applications.
With all the new improvements made to the thread pool and the release of parallel extensions in the latest framework, I am wondering whether the use of smart thread pool gives you more advantage on a latest framework?
Best wishes,
Navaneeth
|
|
|
|
|
The IWorkResult stuff in SmartThreadPool gives it a real advantage over the threadpool (even as it stands now). Parallel extensions however, that's a tough call - usage would have to be evaluated on a case by case basis.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I do all my serious implementations in asp.net but sometimes I need a simple utility which I code as a windows implementation.
It is usually a one off utility to gather information so all I need is to separate the UI (main thread) from a single worker thread so I don't lose control of the UI in case I need to terminate the process or update a process status indicator.
SmartThreadPool may be a bit of an over kill for my requirements but it does look interesting. I'll have to look into it when I get some time to really learn the intricacies of implementing it.
Thanks for the link.
|
|
|
|
|
i'm interest image processing
อำนาจ มณีดุลย์
|
|
|
|
|
It is interesting.
|
|
|
|
|
You will have to try to ask a better question in English.
What would you like to know about image processing?
|
|
|
|
|
Congratulations on getting a hobby! Now, did you have an actual question?
|
|
|
|
|
What is your question please?
|
|
|
|
|
Dave's question was whether the OP had a.... oh nevermind
|
|
|
|
|
|
Why would I be asking a question??
I certainly wouldn't be asking you about it.
You can't even reply to the correct post.
|
|
|
|
|
|
You can't seem to hit Reply to the correct post.
|
|
|
|
|
I'm afraid you'll have to answer him in Thai if you expect him to understand subtle remarks.
You do know Thai well enough to write coherently don't you?
|
|
|
|
|
I want a textbox for a phone number. I want the text box to have this format
( ) - embedded inside it. When some one inputs the phone number the first three numbers (area code) should automatically fit in the bracket area and the next three before the hyphen and the last four after the hyphen (without the user having to type the bracket or the hyphen. I have no idea how to approach the problem.
Pl help
|
|
|
|
|
Search your online help for "maskedit". There will be a ready-made one for phone numbers along with several other useful ones.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
I found many which would format the phone number after it has been entered, but I could not find any where the bracket and the hyphen were already embedded in the textbox when it loads.
If you can direct me to one it would be great.
|
|
|
|
|
This one[^] is for dates in VB, but I am sure you can do the obvious translation. (I don't have C# or VS here, so I'm poking around in the dark a bit.) The main point is that the underlying MaskedEdit control takes care of displaying the extra bits as well as controlling what can be entered.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|