your tutorials are actually the best I have found on this platform in terms of style and content, thanks for that
@SingletonSean
3 жыл бұрын
Thanks Marc, glad the tutorials are helpful!
@pascalguerin5238
3 жыл бұрын
Indeed! If I had your tutorials 10 years ago when I tried WPF the first time, I would've been soooo much more productive and happy! I just donated to you. You should start a patreon or github sponsorship :)
@pascalguerin5238
3 жыл бұрын
I just saw we can join your channel
@an13selm
Жыл бұрын
Excellently stated, with a reference to a challenge many experience within WPF development.
@ElCidPhysics90
2 жыл бұрын
A diagram showing the connections and communication pathways would be really cool. May need to look at the code and try and come up with one.
@veroqtno
3 жыл бұрын
Great, this is what I've been waiting for! Thank you!
@kairausch1462
2 жыл бұрын
insane! Thank you very much!
@bartomiejciurla8472
5 ай бұрын
That was helpfull! Thanks for the tip about disposing
@geocine
2 жыл бұрын
Thank you for your videos @SingletonSean , I come from a JS frontend background and I am struggling to understand WPF. Most of the videos I see here are already outdated and doesn't click with me. Your videos are very clear, I hope you would be doing more of state management videos and thread/tasks/workers as well.
@SingletonSean
2 жыл бұрын
That's great to hear geocine! I'm actually a React developer, so a lot of the WPF decisions I make are inspired by experiences with front-end JS frameworks! I'll definitely be covering those topics as I move more into covering the essentials of building WPF apps.
@piotrgoacki9070
Жыл бұрын
Thank you for the great content! I have a question: what's wrong with having a main parent view model shared between its children view models? OK it is coupled, but only to the main view model which would act as a shared data source. Isn't it cleaner instead of having custom events for everything? It is not a criticism, but a genuine question. Thank you!
@TheMilliardo
3 жыл бұрын
Thank you. Very informative. Stil w8 you're Mvvm navigation tutorial without "main" navigation menu.
@SingletonSean
3 жыл бұрын
Thanks Adrian! You won't be waiting much longer, stay tuned this week. I'm finishing up editing one navigation video, but I expect this to be a series. It will be fun.
@TheMilliardo
3 жыл бұрын
@@SingletonSean Could you show in the video how to add a popup as well? Thank you.
@ivandrofly
2 жыл бұрын
Thanks ;)... another good content!
@SingletonSean
2 жыл бұрын
Thanks Ivandro :)
@solvedplus858
2 жыл бұрын
very awesome tutorial many many thanks but why do you pass product class to store and not passing the product viewmodel it self? can we make the productstore as static class??
@gabrieldesouza7050
2 жыл бұрын
Awesomee tutorial bro!! It is Awesomeee
@user-pw3pu8wu3f
2 жыл бұрын
Question, say that you allow a product to have an image as well which you would select via openfilefdialog and show it in both views. Where you the appropriate place to call fileopenfdialog? In the viewmodel or in the code behind? It's in the code behind how do I communicate from the codebehind to the view model?
@robertthurman8412
Жыл бұрын
Hello Sean, This doesn't seem to work as well as I thought it would as it seems that you have to pass into the constructor viewmodel, an instance of the viewmodel from which you would like to get information. What I've seen is that if I do this then I can't use the viewmodel within my view as it reports that the viewmodel must be parameterless. So am I missing something? or what am I doing wrong?
@gabrieldesouza7050
2 жыл бұрын
Heyy one question, using this settup how would yu communicate with a entity framework ? Happy new year !!
@chisoxnation9499
3 жыл бұрын
Great video as usual! What are your thoughts on incorporating the Windows API in 2021 and is it still needed? .NET versions prior and up to 5.0 have wrapped most functions but there are still some that P/Invoke is needed for. Perhaps a video on this?
@samjiang5851
Жыл бұрын
Anybody has any idea why we want to separate commands in another folder instead of just putting it in the ViewModel. By doing so we need to add a reference of ViewModel in each command, is it coupling the code?
@AdisonCavani
2 жыл бұрын
I have two views (pages) that need to communicate between each other. View1 will fire UpdatedEvent on navigating to View2, and View2 will fire UpdatedEvent on navigating back to View1. Problem: I use DI and ViewModel2 that is connected to View2 is initialized after View1 called UpdatedEvent. So on first navigation, ViewModel2 doesn't fire event, therefore property is not changed. How can I fix this problem?
@lottexy
2 жыл бұрын
Great video but I got lost on the ProductListingViewModel... The whole memory leak thing just confuses me. :( other than that great tutorial.
@hello_world_zz
2 жыл бұрын
thanks
@purswani
3 жыл бұрын
I have one question! What if we want to edit or delete products. As in this example you displayed two ViewModel in one view. Can you please guide about how to create for views individually for both ViewModels.?
@SingletonSean
3 жыл бұрын
Good question Purswani! It would definitely be a similar approach. In this demo, the CreateProduct and ProductListing view models were completely separate from each other, so moving each of those to separate views would result in the same functionality. Regardless, I plan to expand on this concept because it's crucial for WPF/front-end applications. I'll definitely get into edit/delete updates when I do my video on managing application state, because I think it's more related to that concept. Unfortunately, that was all a little bit outside the scope of this tutorial since I just wanted to focus on the communication aspect. But stay tuned!
@joyhoon
2 жыл бұрын
How about make ProductStore class as static? As your channel name suggested in Singleton pattern?
@SingletonSean
2 жыл бұрын
Hey triplehoon, that's a good question. In most cases, it's probably fine to make it static, but I think there are some drawbacks. For example, what if you really wanted multiple instances of a store? This is unlikely in most cases, but I could image how it could happen in larger apps. The other issue with static classes is that they cannot implement interfaces. This causes tight coupling with consumers, and makes testing and mocking difficult. Singletons can implement interfaces, but tight coupling is still an issue if consumer aren't depending on an interface and using constructor injection. Overall, I just prefer to stay away from static classes and singletons. With .NET's dependency injection capabilities, I find it much easier to just inject dependencies through the constructor. It's also nice being able to see what a class depends on just from looking at a constructor, rather than sifting through every method looking for static/singleton class references.
@joyhoon
2 жыл бұрын
@@SingletonSean Wow. Thank you for a detailed answer. It really helps me to understand your concept of communicating between view models.
@GrullonMiguel
3 жыл бұрын
Around 5:27 a message popsup talking about WPF bindings must be on INotifyPropertyChanged objects, otherwise there are potential memory leaks. Can you create a video or point to a video that goes more in-depth? Perhaps start out with code not optimized and then convert to the optimized way to avoid the leaks.
@SingletonSean
3 жыл бұрын
Good idea Miguel, I will consider expanding on this. In the mean time, here's a good article that summarizes the issue: michaelscodingspot.com/ways-to-cause-memory-leaks-in-dotnet/#:~:text=WPF%20Bindings%20can%20actually%20cause,a%20memory%20leak%20(explanation).
@GrullonMiguel
3 жыл бұрын
@@SingletonSean awesome. Thanks for the link. It is extremely helpful
@zerosandones7547
3 жыл бұрын
How do you read these @5:35 (public string Name => _product.Name;) ?
@SingletonSean
3 жыл бұрын
Good question Zeroes and Ones. That is known as a get accessor property: docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/using-properties#the-get-accessor
@zerosandones7547
3 жыл бұрын
@@SingletonSean so, is this basically a readonly property? I have been using e.g. public string Name { get; }
@MrDragos360
3 жыл бұрын
WPF is sooo complicated compared to VueJS SPA and both do the same thing. A client/front-end for an API. Any ideea why Microsoft made is so dificult ? Are there any big advantajes of making an app in WPF instead of VueJS plus Electron in case you really need a desktop UI ? It's really weird that it's sooo damn dificult compared to something that can do the same thing.
@SingletonSean
3 жыл бұрын
Good point Dragos, as someone who builds web apps (usually Vue as well, go Vue!), I feel the same way sometimes. I don't necessarily think Microsoft made it difficult on purpose. Keep in mind WPF was born over a decade ago and quite a while before the birth of reactive JS frameworks. That said, it's kind of surprising how powerful WPF is in terms of reactivity and MVVM. Electron is great. I've used it a few times and it gets the job done. A bit buggy, a tad slower, takes up more space, but great tool. Feels great using JS, and also destroys WPF in terms of building responsive apps. Cross-platform is useful too. So why use WPF? The strongly typed C# is nice, but also contributes to the reason that it feels difficult. It's also a native Windows app, so it's more performant than Electron and allows us to interact with Windows specific APIs easier (registries, file systems, etc.). It's quirky, but I can't see electron ever replacing WPF entirely.
@mikefocal5770
3 жыл бұрын
hi, are you using Prism?
@SingletonSean
3 жыл бұрын
Hey mike, I am not using Prism. I feel comfortable with the raw power of WPF, and do not feel a framework is necessary. Perhaps I'll try one when I feel I need it though!
@mikefocal5770
3 жыл бұрын
@@SingletonSean many thanks for your response , you're doing a great tutorials, is there a dedicated video to MVVM, I'm sure you have a lot to say.
@makahmed7130
3 жыл бұрын
View Models shouldn't directly communicate with each other
@SingletonSean
3 жыл бұрын
Hey Mak, I agree! That is why we setup the mediator in this video. I'm assuming this comment is just a summary of the video.
@randyblock8747
3 жыл бұрын
Always good information, but I did like it better when you did things a little slower. A little hard to follow (at least for me)
Пікірлер: 46