Async delegate causes WPF to freeze until search is done
I used delegates to implement async search in my program. I have a progress bar and a label that says "Starting Search..." that should be shown while searching. Currently, the wpf window freezes while searching, and the progress bar and label are not displayed. After the search is done, it'll update the label to show "Match is found" or "Match is not found". I implemented the same functionality using await, but I just can't figure out why I can't get it to work with delegates. I've been trying to debug this for about a week with no progress, so any help would be greatly appreciated
Code: https://pastebin.com/tdxTWT8C
Pastebin
namespace DelegateClient{ public partial class MainWindow : Wind...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
3 Replies
this is an old outdated way of doing async, it's not even supported at all in modern .NET (which you should also be using and not .NET Framework)
you should be using async/await
i would highly advise you to ditch whatever documentation or learning material you're using
not even the async stuff (which is ancient), but explicit Tuple<>s...
yeah i suspect this is based on either a super old guide or a course that you should definitely drop if it's teaching you stuff like this with the expectation of it having a practical use in the real world