Hah, SingletonSean. I've been on one of your videos before, but only now with some increase knowledge I appreciate the pun. For this video (although it being 3 years old), I don't think using async void is good in any case. Multiple sources say so, and when I did implement it I landed in the exact situation they warned me for. If you want to fire the task and forget it, make it a void and handle the task appropriate.
your videos are the best around man! keep going! Can you make an hour with the basics and best practices for a begginer at wpf? i would be interested in that
Hey Fuzzy, I definitely have plans for this. I originally wanted my "Full Stack WPF MVVM" playlist to satisfy this need, but that series has become a bit too long. A quick crash course would be great. Thanks for the suggestion!
what about cancelling a long running command. cancellationtokens don't really have a reset.. so if you call cts.cancel for example.. if you user fixes the input then presses the go button again the cancellation token still says cancelled. thanks for any feedback or ideas
Hi Sean, I recently discovered your channel and I am thrilled I can still find active desktop developers here. I am planning to watch all your WPF series from the beginning but I have a queestion for you: can you create a video for exception handling in .NET/WPF? Where we should handle the exceptions if we also have class libraries or different layers on our app? At the class library level and inform the user via an event, or we should log the exception and re-throw it?
Hey Mihai, that's a great question and exception handling is super important. I'll add that to my list of things to do. Ironically, you commented on a pretty relative video, haha. I typically handle exceptions inside of my commands. This allows me to catch the exception, investigate it, and then set some kind of error message on the view model to notify the view. Of course, it's never a bad idea to catch/re-throw inside of a library for logging purposes, but at the end of the day I like my exceptions to funnel up to my view models/commands so that I can notify the user through the UI. Hopefully that helps a little bit, thanks Mihai!
Hi sean, every video that you make are all great and informative! and I am learning a lot. If you don't mind, can you show us also how you would handle a Datagrid with controls like ComboBox in it that's binded to an observablecollection property, I have an idea how to do it but somehow it's having performance issues in the speed of display and how will you handle large records aside from paging. Thanks
Hey chaw chaw, sounds like an interesting use case. I'm interested in doing some videos on more specific WPF controls, so this would be a good topic to go over. Also, for performance issues, you might want to check out UI virtualization: docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/optimizing-performance-controls I've used this in production software and it makes a big difference. It's also easy to setup (just toggle an attached property on the DataGrid, magic) Thanks for the suggestion!
Great content, it's helping me a lot during my internship thank you so much, and i was hoping you could do some videos on prism because it's not well covered, again thank you
As always, you're the best. Thank you for sharing your knowledge with us. I have one question though. What if I want to pass a parameter in the callback? Can you please do a video on that? Thanks!
Thank you, once again, for a great content. I do have a question about the RelayCommand case, specifically regarding the lambda exception action in the constructor of LoginViewModel. Since the callback is in the view model, is it possible to handle exceptions within the callback and set the StatusMessage there, or are there going to be issues with scoping or race conditions?
Thanks Kuldeep! A tutorial on MVVM popups is on the way. Navigation is the most requested topic I've received, and honestly it's probably the one thing in WPF I've run into the most issues with in the past. Definitely a good video topic!
Great tutorials as always thanks brother. Do you think making CanExecute method virtual to later on override for extra checks is a good idea or is there a better way around it that you can suggest ?
I read that it's a bad practice to use Async Void, and try/catch it's not gonna help with async void if there is an exception; ref Stephen Cleary. What is you opinion on that statement?
Good point, veroqtno. I am familiar with Stephen Cleary's (and other great developer's) async wisdom. However, async void event handlers are acceptable, and a command is similar to an event handler since we're handling button clicks (although it is not syntactically similar, but same concept). We can try and dance around async void as much as we want, but an async void is required for event handlers.
Thanks Wahid! I do not have any videos on CancellationTokens yet, but that is a great suggestion. Perhaps I could show off an AsyncCommand with a CancellationToken as well.
Hey David, I think UWP is great for building Windows apps for the Windows Store and for the platforms that UWP supports. However, since WPF came before UWP, I just haven't checked out UWP yet because I feel WPF is strong enough for desktop development. I think other developers have similar feelings, hence why UWP hasn't gained as much traction yet. I am interested in checking out UWP though, so perhaps in the future! Considering the UI is XAML based, I can't imagine it is difficult to adjust from WPF. I've recently been doing a lot of Xamarin, which is also XAML based, and have noticed many similarities compared to WPF. In fact, it's easier in some cases! Hopefully UWP XAML is similar.
Hey Göthâkar, I've seen some RUclipsrs add effects like this in the past, but I didn't really think it added much value. I also have limited experience in video editing. However, this comment inspired me to spend some time with practicing video editing today, and I actually think the zoom is a LOT nicer for visibility (maybe I just didn't like it before because I had never tried, haha). Turns out video editing is pretty fun. Thanks for the suggestion Göthâkar, I'm excited to add this to videos in the future and improve the quality of my videos!
Now I clearly understood the async relay commmand. Thanks.
Man you got everything I ask for :) Keep up the good work man
Hah, SingletonSean. I've been on one of your videos before, but only now with some increase knowledge I appreciate the pun.
For this video (although it being 3 years old), I don't think using async void is good in any case. Multiple sources say so, and when I did implement it I landed in the exact situation they warned me for. If you want to fire the task and forget it, make it a void and handle the task appropriate.
your videos are the best around man! keep going!
Can you make an hour with the basics and best practices for a begginer at wpf? i would be interested in that
Hey Fuzzy, I definitely have plans for this. I originally wanted my "Full Stack WPF MVVM" playlist to satisfy this need, but that series has become a bit too long. A quick crash course would be great. Thanks for the suggestion!
Hi Sean, is it a common practice to use the ViewModel in a command to acces the properties of the ViewModel?
Great content and explanations @SingleonSean, these are great content to show young developers I have.
Thanks Lucky, glad to hear you're sharing this content with others!
what about cancelling a long running command. cancellationtokens don't really have a reset.. so if you call cts.cancel for example.. if you user fixes the input then presses the go button again the cancellation token still says cancelled.
thanks for any feedback or ideas
Hi Sean, I recently discovered your channel and I am thrilled I can still find active desktop developers here. I am planning to watch all your WPF series from the beginning but I have a queestion for you: can you create a video for exception handling in .NET/WPF? Where we should handle the exceptions if we also have class libraries or different layers on our app? At the class library level and inform the user via an event, or we should log the exception and re-throw it?
Hey Mihai, that's a great question and exception handling is super important. I'll add that to my list of things to do. Ironically, you commented on a pretty relative video, haha. I typically handle exceptions inside of my commands. This allows me to catch the exception, investigate it, and then set some kind of error message on the view model to notify the view. Of course, it's never a bad idea to catch/re-throw inside of a library for logging purposes, but at the end of the day I like my exceptions to funnel up to my view models/commands so that I can notify the user through the UI. Hopefully that helps a little bit, thanks Mihai!
Hi Sean what about properties that use multiple place ?
How to set it and use it anywhere
Hi sean, every video that you make are all great and informative! and I am learning a lot. If you don't mind, can you show us also how you would handle a Datagrid with controls like ComboBox in it that's binded to an observablecollection property, I have an idea how to do it but somehow it's having performance issues in the speed of display and how will you handle large records aside from paging. Thanks
Hey chaw chaw, sounds like an interesting use case. I'm interested in doing some videos on more specific WPF controls, so this would be a good topic to go over. Also, for performance issues, you might want to check out UI virtualization: docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/optimizing-performance-controls I've used this in production software and it makes a big difference. It's also easy to setup (just toggle an attached property on the DataGrid, magic) Thanks for the suggestion!
Keep it up your good work and explanation. U deserved more views and subscribers. Thanks mate
Thanks Dion, just happy to be helping the subscribers and viewers that I have!
Great content, it's helping me a lot during my internship thank you so much, and i was hoping you could do some videos on prism because it's not well covered, again thank you
Hey sean us it possible to have an async CanExecute method?
As always, you're the best. Thank you for sharing your knowledge with us. I have one question though. What if I want to pass a parameter in the callback? Can you please do a video on that? Thanks!
Thanks omostan! 🚀
Thank you, once again, for a great content. I do have a question about the RelayCommand case, specifically regarding the lambda exception action in the constructor of LoginViewModel. Since the callback is in the view model, is it possible to handle exceptions within the callback and set the StatusMessage there, or are there going to be issues with scoping or race conditions?
hello thanks for the great tut
i tried the same step as you have done with a progress bar but the UI didn't updated
can you tell me why ?
i found what i missed sorry your code work perfectly
Awesome you gave me the answer to stop spamming button
Hi Sean, nice videos, good job; Could you please make a video to display data in popup window using mvvm?
Thanks Kuldeep! A tutorial on MVVM popups is on the way. Navigation is the most requested topic I've received, and honestly it's probably the one thing in WPF I've run into the most issues with in the past. Definitely a good video topic!
Great tutorials as always thanks brother. Do you think making CanExecute method virtual to later on override for extra checks is a good idea or is there a better way around it that you can suggest ?
Thanks C T! I usually just make CanExecute virtual and override it in base classes. I think this is the simplest and most efficient way.
I read that it's a bad practice to use Async Void, and try/catch it's not gonna help with async void if there is an exception; ref Stephen Cleary. What is you opinion on that statement?
Good point, veroqtno. I am familiar with Stephen Cleary's (and other great developer's) async wisdom. However, async void event handlers are acceptable, and a command is similar to an event handler since we're handling button clicks (although it is not syntactically similar, but same concept). We can try and dance around async void as much as we want, but an async void is required for event handlers.
Thank you! Your videos are great please keep up with the great work! I like to see more from WPF MVVM
Hi Sean, very nice videos.
Greetings from Russia ;)
Greetings Anonym, glad you're enjoying :)
great video, as usual . Do you have video where you added CancellactionToken
Thanks Wahid! I do not have any videos on CancellationTokens yet, but that is a great suggestion. Perhaps I could show off an AsyncCommand with a CancellationToken as well.
@@SingletonSean i didn't see this till i already posted but yes yes yes..if you are ever near MI all the beer or whatever you want is on me
Really nice content. Keep it up.
This type of CollectionView does not support changes to its SourceCollection from a thread different from the Dispatcher thread
No worries Andrew, hope this helps :) docs.microsoft.com/en-us/dotnet/api/system.windows.threading.dispatcher.invoke?view=net-5.0
@@SingletonSean So I'm going to try and get the results of a request and then update the collection via the result, does that sound right?
@@SingletonSean Yup, that worked!
That's great news! I've run into that quirk quite a lot with ObservableCollections and ICollectionView.
Fantastic channel
Been watching your videos, Wonder why you don't use UWP?
Hey David, I think UWP is great for building Windows apps for the Windows Store and for the platforms that UWP supports. However, since WPF came before UWP, I just haven't checked out UWP yet because I feel WPF is strong enough for desktop development. I think other developers have similar feelings, hence why UWP hasn't gained as much traction yet.
I am interested in checking out UWP though, so perhaps in the future! Considering the UI is XAML based, I can't imagine it is difficult to adjust from WPF. I've recently been doing a lot of Xamarin, which is also XAML based, and have noticed many similarities compared to WPF. In fact, it's easier in some cases! Hopefully UWP XAML is similar.
thanks
yea, why dont just zoom sometimes when the explanation is started... man
Hey Göthâkar, I've seen some RUclipsrs add effects like this in the past, but I didn't really think it added much value. I also have limited experience in video editing.
However, this comment inspired me to spend some time with practicing video editing today, and I actually think the zoom is a LOT nicer for visibility (maybe I just didn't like it before because I had never tried, haha). Turns out video editing is pretty fun. Thanks for the suggestion Göthâkar, I'm excited to add this to videos in the future and improve the quality of my videos!