edgarka_
Avalonia ListBox pass selected DataTemplate
I put a behavior under ListBox to respond on the item clicked, is there a way to pass selected list member to VM? The code is in the file here: https://paste.mod.gg/lapcinshlpan/0 (now it passes current one that is set in code)
17 replies
✅ 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
❔ 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
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