برای این کار بهترین راه مدیریت کدها با استفاده از multi thread و background worker هست
https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/threading-model
https://docs.microsoft.com/en-us/dotnet/standard/collections/thread-safe/when-to-use-a-thread-safe-collection
https://stackoverflow.com/questions/11581236/c-sharp-threading-run-and-cancel-button-need-to-be-able-to-cancel-long-proccess
2,332 سوال
2,871 پاسخ
3,725 دیدگاه
3,905 کاربر