Yes, it can be painful -- but I have learned this is with everything(As I'm sure you know)! I'm glad that I could aid in the confusion this can sometimes bring. When taking small bites at a time, confusing things can become very clear.
Suggstion: Make sure your volume is consistent across all your videos. The first one in this series are louder than the following ones. Excellent series! Very helpful to a WPF noob!
Action was the biggest hit for me here. As a bonus I've got some inside on delegates and what is the benefit (beyond of what I've read). I have a github where I'm putting the code so resolved matters and code upgrades are visible even better.
Thank you so much for this tutorial! This is only one that explicitly explain how those delegation work, also I love the metaphorical ways (Universal remote for various appliances) you used to explain why we use this technique in the first place. That make me much much effort to understand the concept compare to those obscure Microsoft Documents and complicated examples in CodeProject website.
Thank you for making this simple. I am just jumping into MVVM and appreciate the example that does not over complicate the process. I have been taught code-behind all throughout college, but we never delved into any of this wonderful stuff. Goodbye code-behind. At least for apps. I was going for Software Engineering so that is a big difference, but they also taught the app dev side.
Delegates were certainly confusing for me at first. The best way I can explain them is that you should think of them like variables, but for methods/functions. No different than you assign a number to an int variable, you assign a method to a delegate. You can then invoke it by the container instead of calling the method directly.
How would i use this when listening for KeyDown events? Right now i have it set up such that the KeyDown events triggers a method, written in the 'window' xaml tag. Seems like i am not able to use bindings with KeyDown events. any tips?
The volume of your video plays back low compared to the advertisements and other videos in general. You sound great, Clarity is awesome and you articulate the subject matter well. I wonder if your content may be underrated because people are assuming the sound is bad or becoming frustrated after adjusting volume (3x normal my setup none headphones) and getting blasted by the commercials. Keep up the good work.
Yeah an unfortunate reality. Funny thing is I was aware of this and would crank my audio up 3x in post production and would still have this issue. Must have been a variety of factors of configuration when recording. Hate to say it, but I am clueless when it comes to that stuff.
How would i go about changing a View.Frame.Content using bindings? I assume that it is the ViewModel that needs to change it based on "x" and "y", and not the view itself, where the frame lies?
thanks, but how if textbox empty messegebox warning, or we add checkbox if checked messegebox show if uncheck messegebox not show? Can u create sample?
Thanks for the video. I have a problem with the source. For me the textbox context is not showing in the messagebox. Somehow the set method of the property is not raised. I tried to get your source code but clicking on the link just redirects me on the home page of toskercorner and not to the source. How can I get the source?
Hey Toskers thanks for your video! I have a question : Can I have 2 classes "MessageCommand"? One to use with Commands with parameters and another with without parameters? What do you think about this? Thanks
@@sleepysundaymorning5034 Currently i am a little tied up. I wouldnt be available until abou 3 to 4 hours, and even then maybe not until tomorrow. So its possible, just not sure at the moment.
It's easy to feel that way. It's a bit of a learning curve, but you will pass it with time and repetition. No problem though, feel free to message me if you ever have questions. Always willing to try to help!
Great tutorial. I'm studying WPF for about 2 weeks. However, after 6:35, it started to need clarification for me. Please make a 5 years video duration to explain these details for a noob like me.
Great video - I already watched a few vids from you, and each helped me a bit. Subbed today. Just one thing, I'd like to mention: I always have to raise the volume for your videos a lot. The when the commercials kick in, it's blasting my ears off. So, please, please, raise the volume when editing your vids. Otherwise: thumbs up!!!
Yeah my videos vary in that regard. I used to be editing my videos with a really weird speaker, that would mislead me on volume levels when I would render them. Some videos should be better, so sorry! And tell your ears I said sorry too.
Error Under Constructor: "There is no argument given that corresponds to the required formal parameter 'execute' of 'ObservableObject.ObservableObject(Action)'". Error Under parameter of ObservableObject: cannot convert method group to Action I don't understand whats the problem. Can you please suggest any suggestion.
could you tell my how it is happens , that when you call a MessageCommand it will invoke the public void Execute(object parameter) method. How it is happen, that it goes to Execute method directly ? I can't get it.
It can be confusing because some things happen behind the scenes that you did not personally develop. I'll explain the best I can. To put it simply, in your WPF control the `Command` property we bind to is designed to work with the ICommand interface we implement. This is why we must use that interface, because the Command property will look for the `Execute` method in whatever it is bound to -- given it implements the ICommand interface. So yes, when we bind to the `Command` property in our XAML, it knows it must go directly to the execute method. If you still find it confusing, you may understand it more if you look a little more into interfaces and how they work. Hope I helped!
ToskersCorner i know-how the interface works. its Haven declarations of method and classes which you have to declare in Chili children class. but it no execute any methods by default like here the execute method. so i have to take it as it have to be, that Command option in xaml will always Look for the Execute method in binded object? please tell me if i get it right? many thanks for help!
The control with the Command property is what knows how to handle it. For example, the `Button` has a built in functionality to know how to use the ICommand interface when its Command property is bound -- It does this with something called an ICommandSource. For further research, you can check out this link: docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/how-to-implement-icommandsource
Great video, and I really appreciate your work. But I still don't understand instantiating the viewmodel in the codebehind rather than just setting it in the XAML.
Can you do a video on how MMVM fits together? I get all of these interfaces now (due to your great vids) but I can't get how to fit it all in to a full MVVM app
Daniel Wilkes Sorry for the late response. If you are interested in a video that combines the concepts you could check out my vending machine and notepad series. I do hope to do more videos, but i dont have much time now that school is started up again.
And also, the command implementation you showed in the video can be used for any situation since it doesn't contain any logic, except it doesn't have a proper canexecute method implementation. Good job tho
I think you may br disregarding the fact that these are educational videos and you are analyzing too deep. They are intended to be baby steps for beginners to grasp the concept before getting in the more nitty gritty. I make implementations as minimal as i can so there is less information to overwhelm beginners, preventing them from focusing on the important points the video is intended to convey.
just watching this first video my mind is like, Why I've to use a command and all that stuff, if I can just use click event! hahahahaha, (Windows forms mind)
I don't like to re-explain things that have been explained in other videos, and you are among the minority because many people appreciate that. Personally, I hate videos that explain things outside the context of the video. It may be 20 seconds, but if just do 20 second explanations for every single thing, they add up.
WPF is indeed mind twisting. Thanks for making learning it a bit less painful.
Yes, it can be painful -- but I have learned this is with everything(As I'm sure you know)! I'm glad that I could aid in the confusion this can sometimes bring. When taking small bites at a time, confusing things can become very clear.
I'm glad to hear i'm not alone in feeling challenged by learning WPF.
I find that is's surprisingly difficult to fathom ...
* 5 years later... * : survey taken! Thank you for these tutorials, they are all well made and very helpful.
Suggstion: Make sure your volume is consistent across all your videos. The first one in this series are louder than the following ones. Excellent series! Very helpful to a WPF noob!
Very good example of using ICommand in the MVVM pattern. Thanks a lot for sharing
And boom. I now understand Command and Bindings. Thank you so much.
Omg, this was so so so simple but the documentation makes it seem so intimidating. Thanks for the video.
Damn - I think I've found my go-to guy for transitioning me into WPF MVVM! Excellent tutorial - thanks. 👍👍
Best video about ICommand in WPF I ever saw! Thanks, very informative!
Bada bing, bada boom, thank You :) After this everything seems really clear. The length is spot on and You keep it consistent.
Glad to hear, which questions have been answered based on your last comment? Some, or all?
Action was the biggest hit for me here. As a bonus I've got some inside on delegates and what is the benefit (beyond of what I've read). I have a github where I'm putting the code so resolved matters and code upgrades are visible even better.
Thank you so much for this tutorial! This is only one that explicitly explain how those delegation work, also I love the metaphorical ways (Universal remote for various appliances) you used to explain why we use this technique in the first place. That make me much much effort to understand the concept compare to those obscure Microsoft Documents and complicated examples in CodeProject website.
Nelson Yang Thank you very much for your comment. Its always good to hear about my videos helping people!
Thank you for making this simple. I am just jumping into MVVM and appreciate the example that does not over complicate the process. I have been taught code-behind all throughout college, but we never delved into any of this wonderful stuff. Goodbye code-behind. At least for apps. I was going for Software Engineering so that is a big difference, but they also taught the app dev side.
Glad I could help. Feel free to check out some other videos if you wish!
really It's very easy, considering your way to use teaching us. Thanks for help. I'm learning to develop since zero with your teaching
Great video. Would like to see you do some on UWP.
Excellent video, well explained, thank you for creating!
Thank you, your explanation is really clear.
that was a great lesson. Easy to follow and simple enough. Thank you sir.
Loved It ,literally It's the same as needed.
Man I wish you would redo your WPF videos. You have the best explanations of why certain things are done. Very solid videos.
I say redo but really mean update with current WPF methodology
This was amazing, super helpful and easy to follow! Thanks!
thanks man! good job
Great Video, best I've seen so far on the subject, I'm still confused with delegates but I guess with time and practice I'll get it.
Delegates were certainly confusing for me at first. The best way I can explain them is that you should think of them like variables, but for methods/functions. No different than you assign a number to an int variable, you assign a method to a delegate. You can then invoke it by the container instead of calling the method directly.
Thanks, after practicing a bit I got it now, you're right it's like a variable for methods.
So underrated video.
MrMaczupiczu Thank you!
How would i use this when listening for KeyDown events? Right now i have it set up such that the KeyDown events triggers a method, written in the 'window' xaml tag. Seems like i am not able to use bindings with KeyDown events. any tips?
Just what I needed. Thanks :)
The volume of your video plays back low compared to the advertisements and other videos in general. You sound great, Clarity is awesome and you articulate the subject matter well. I wonder if your content may be underrated because people are assuming the sound is bad or becoming frustrated after adjusting volume (3x normal my setup none headphones) and getting blasted by the commercials. Keep up the good work.
Yeah an unfortunate reality. Funny thing is I was aware of this and would crank my audio up 3x in post production and would still have this issue. Must have been a variety of factors of configuration when recording. Hate to say it, but I am clueless when it comes to that stuff.
How would i go about changing a View.Frame.Content using bindings? I assume that it is the ViewModel that needs to change it based on "x" and "y", and not the view itself, where the frame lies?
Thank for the video, great work, clear explanation.
thanks , very good "PROFESSOR" !
thanks, but how if textbox empty messegebox warning, or we add checkbox if checked messegebox show if uncheck messegebox not show?
Can u create sample?
Thanks for the video. I have a problem with the source. For me the textbox context is not showing in the messagebox. Somehow the set method of the property is not raised.
I tried to get your source code but clicking on the link just redirects me on the home page of toskercorner and not to the source. How can I get the source?
Great Job my Friend
Hey Toskers thanks for your video! I have a question : Can I have 2 classes "MessageCommand"? One to use with Commands with parameters and another with without parameters? What do you think about this? Thanks
Wonderful Video. Thank you for posting it!
The action implementation can be both done through method of View Model, or through the command itself.
You are correct. And that is shown in part 2! -- i believe, it has been a while.
Yes, i ve just seen it. Working on my final course work on WPF so everything has to be perfect. Can you help me a little bit in chat?
@@sleepysundaymorning5034 Currently i am a little tied up. I wouldnt be available until abou 3 to 4 hours, and even then maybe not until tomorrow. So its possible, just not sure at the moment.
@@ToskersCorner ill just text you my problem, and as you want you may answer it
@@ToskersCorner youtu.be/addme/MIQcMcwgaA4aKIVSY4uLeHXLQf7Row invitation link to chat
Merci beaucoup pour cette video
I realize I'm in way over my depth. Thanks for making the video by the way :)
It's easy to feel that way. It's a bit of a learning curve, but you will pass it with time and repetition.
No problem though, feel free to message me if you ever have questions. Always willing to try to help!
Great tutorial. I'm studying WPF for about 2 weeks. However, after 6:35, it started to need clarification for me. Please make a 5 years video duration to explain these details for a noob like me.
I wish the source code was available on github, the link doesn't work.
Great video, thank you! :-)
You're the best Bro
Great video - I already watched a few vids from you, and each helped me a bit. Subbed today. Just one thing, I'd like to mention: I always have to raise the volume for your videos a lot. The when the commercials kick in, it's blasting my ears off. So, please, please, raise the volume when editing your vids. Otherwise: thumbs up!!!
Yeah my videos vary in that regard. I used to be editing my videos with a really weird speaker, that would mislead me on volume levels when I would render them. Some videos should be better, so sorry! And tell your ears I said sorry too.
Hi, How can I fire the CanExecuteChanged event from my ViewModel?
Really useful. Many thanks
Error Under Constructor: "There is no argument given that corresponds to the required formal parameter 'execute' of 'ObservableObject.ObservableObject(Action)'".
Error Under parameter of ObservableObject: cannot convert method group to Action
I don't understand whats the problem. Can you please suggest any suggestion.
how and where does public void Execute(object parameter) get called?
was quite useful, thanks!
could you tell my how it is happens , that when you call a MessageCommand it will invoke the public void Execute(object parameter) method. How it is happen, that it goes to Execute method directly ? I can't get it.
It can be confusing because some things happen behind the scenes that you did not personally develop. I'll explain the best I can. To put it simply, in your WPF control the `Command` property we bind to is designed to work with the ICommand interface we implement. This is why we must use that interface, because the Command property will look for the `Execute` method in whatever it is bound to -- given it implements the ICommand interface. So yes, when we bind to the `Command` property in our XAML, it knows it must go directly to the execute method. If you still find it confusing, you may understand it more if you look a little more into interfaces and how they work.
Hope I helped!
ToskersCorner
i know-how the interface works. its Haven declarations of method and classes which you have to declare in Chili children class. but it no execute any methods by default like here the execute method. so i have to take it as it have to be, that Command option in xaml will always Look for the Execute method in binded object? please tell me if i get it right?
many thanks for help!
The control with the Command property is what knows how to handle it. For example, the `Button` has a built in functionality to know how to use the ICommand interface when its Command property is bound -- It does this with something called an ICommandSource. For further research, you can check out this link: docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/how-to-implement-icommandsource
Great video, and I really appreciate your work. But I still don't understand instantiating the viewmodel in the codebehind rather than just setting it in the XAML.
The code download link is dead
This is so great!!!!!! :)
Can you do a video on how MMVM fits together? I get all of these interfaces now (due to your great vids) but I can't get how to fit it all in to a full MVVM app
Daniel Wilkes Sorry for the late response. If you are interested in a video that combines the concepts you could check out my vending machine and notepad series. I do hope to do more videos, but i dont have much time now that school is started up again.
Absolute legend!
hi please upload a video to export datagrid to excel file in wpf mvvm
Thanks for the video(s)!
Thanks for watching them. :)
Nice tutorial
Thanks!
buckling springs ?
Thank you so much!
And also, the command implementation you showed in the video can be used for any situation since it doesn't contain any logic, except it doesn't have a proper canexecute method implementation. Good job tho
I think you may br disregarding the fact that these are educational videos and you are analyzing too deep. They are intended to be baby steps for beginners to grasp the concept before getting in the more nitty gritty. I make implementations as minimal as i can so there is less information to overwhelm beginners, preventing them from focusing on the important points the video is intended to convey.
I watched dozens of videos in mvvm but every time I watch a new one I see myself so beginner, why Microsoft did it hard like that 😫
just watching this first video my mind is like, Why I've to use a command and all that stuff, if I can just use click event! hahahahaha, (Windows forms mind)
At 11:43 like you do not have 20 seconds for an "in a nutshell" explanation... Low effort video
I don't like to re-explain things that have been explained in other videos, and you are among the minority because many people appreciate that. Personally, I hate videos that explain things outside the context of the video. It may be 20 seconds, but if just do 20 second explanations for every single thing, they add up.
Couldn't watch more that 20 seconds after you opened visual studio. Your keyboard is beyond annoying.
Sorry you feel that way. :)