EdgarKa
EdgarKa
CC#
Created by EdgarKa on 3/9/2023 in #help
✅ BackgroundWorker in WPF MVVM
Hi! I'm trying to get progressbar and text to update while performing a lengthy task. I was wondering if it is possible to do so or should I create a thread for "PerformTask" file separately? I tried to play around with BackgroundWorker, and it updates "CurrentProgress" variable, but UI updates only after execution. GitHub: https://github.com/EdgarKa/AsyncProgressDemo Thank you 🙂 Edit: I dropped GitHub repo so it would be easier to see and/or run as due to files amount it would be lengthy
17 replies
CC#
Created by EdgarKa on 1/19/2023 in #help
❔ WPF MVVM ModelViews and Views
I have recently learned that ModelView can't have UI elements in it (bad practice). Hence, couple of questions: - If VM should not handle display UIs, how can I display messageBox to the user that, let's say, puts wrong input? If I don't want to grey out button or put message in red "wrong input"? - Is it not good to open new window on button click? Went online, but it's suggested to change views (if it's User Controls) or use modals (overlay main window). How does it work with new windows?
2 replies
CC#
Created by EdgarKa on 11/23/2022 in #help
❔ ❔ Bind selected items
28 replies
CC#
Created by EdgarKa on 8/29/2022 in #help
How to save time on multiple file zipping
Hiya. I have a tool that builds and copies files into specified directory and then zips them. It is currently consists of the following: Class { Foreach () { F1 (); // copying files Zip(); // zipping these files F2(); F3(); Zip(); // zipping F1, F2 & F3 into different archive }} I would like to call Zips and while they are zipping, perform further until it hits another Zip function and start when previous zipping is finished. I’ve tried to play around with async (currently learning), but not exactly sure how to work it out. Could anyone advice please?
27 replies