C# WPF - Commands [Part 1 Intro + Singular Commands]

Поделиться
HTML-код
  • Опубликовано: 13 дек 2024

Комментарии • 91

  • @generalcontrol
    @generalcontrol 7 лет назад +27

    WPF is indeed mind twisting. Thanks for making learning it a bit less painful.

    • @ToskersCorner
      @ToskersCorner  7 лет назад +3

      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.

    • @VaderFaderVader
      @VaderFaderVader 7 лет назад +5

      I'm glad to hear i'm not alone in feeling challenged by learning WPF.
      I find that is's surprisingly difficult to fathom ...

  • @TheJoker-te7te
    @TheJoker-te7te 2 года назад

    * 5 years later... * : survey taken! Thank you for these tutorials, they are all well made and very helpful.

  • @dw71273
    @dw71273 3 года назад +4

    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!

  • @vxco
    @vxco 5 лет назад +1

    Very good example of using ICommand in the MVVM pattern. Thanks a lot for sharing

  • @totototo4093
    @totototo4093 3 года назад

    And boom. I now understand Command and Bindings. Thank you so much.

  • @metin4yt
    @metin4yt 4 года назад

    Omg, this was so so so simple but the documentation makes it seem so intimidating. Thanks for the video.

  • @MagoMakes
    @MagoMakes 2 года назад

    Damn - I think I've found my go-to guy for transitioning me into WPF MVVM! Excellent tutorial - thanks. 👍👍

  • @KitPatron
    @KitPatron 7 лет назад

    Best video about ICommand in WPF I ever saw! Thanks, very informative!

  • @miloszodin
    @miloszodin 7 лет назад

    Bada bing, bada boom, thank You :) After this everything seems really clear. The length is spot on and You keep it consistent.

    • @ToskersCorner
      @ToskersCorner  7 лет назад

      Glad to hear, which questions have been answered based on your last comment? Some, or all?

    • @miloszodin
      @miloszodin 7 лет назад

      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.

  • @crusaderzero3984
    @crusaderzero3984 7 лет назад

    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.

    • @ToskersCorner
      @ToskersCorner  7 лет назад

      Nelson Yang Thank you very much for your comment. Its always good to hear about my videos helping people!

  • @JustinUrban1
    @JustinUrban1 6 лет назад

    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.

    • @ToskersCorner
      @ToskersCorner  6 лет назад +1

      Glad I could help. Feel free to check out some other videos if you wish!

  • @jaderdaconceicao3695
    @jaderdaconceicao3695 5 лет назад

    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

  • @GuildOfCalamity
    @GuildOfCalamity 3 года назад

    Great video. Would like to see you do some on UWP.

  • @jonpopeadventures
    @jonpopeadventures 3 года назад

    Excellent video, well explained, thank you for creating!

  • @sandrinaribeiro7978
    @sandrinaribeiro7978 3 года назад

    Thank you, your explanation is really clear.

  • @omervts8118
    @omervts8118 6 лет назад

    that was a great lesson. Easy to follow and simple enough. Thank you sir.

  • @akashverma1640
    @akashverma1640 4 года назад

    Loved It ,literally It's the same as needed.

  • @ElCidPhysics90
    @ElCidPhysics90 2 года назад

    Man I wish you would redo your WPF videos. You have the best explanations of why certain things are done. Very solid videos.

    • @ElCidPhysics90
      @ElCidPhysics90 2 года назад

      I say redo but really mean update with current WPF methodology

  • @TaughtSimply
    @TaughtSimply 6 лет назад

    This was amazing, super helpful and easy to follow! Thanks!

  • @lesterfonseca7863
    @lesterfonseca7863 4 года назад +1

    thanks man! good job

  • @jaydigging2009
    @jaydigging2009 7 лет назад

    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.

    • @ToskersCorner
      @ToskersCorner  7 лет назад +2

      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.

    • @jaydigging2009
      @jaydigging2009 7 лет назад

      Thanks, after practicing a bit I got it now, you're right it's like a variable for methods.

  • @MrMaczupiczu
    @MrMaczupiczu 7 лет назад +7

    So underrated video.

  • @Exclusivelolviews
    @Exclusivelolviews 5 лет назад

    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?

  • @Hazit90
    @Hazit90 4 года назад

    Just what I needed. Thanks :)

  • @KacieJscott
    @KacieJscott 4 года назад

    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.

    • @ToskersCorner
      @ToskersCorner  4 года назад

      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.

  • @MrBa143
    @MrBa143 5 лет назад

    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?

  • @laszloebner8700
    @laszloebner8700 5 лет назад

    Thank for the video, great work, clear explanation.

  • @saturninramirez1107
    @saturninramirez1107 2 года назад

    thanks , very good "PROFESSOR" !

  • @ginanjarbambang7122
    @ginanjarbambang7122 5 лет назад

    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?

  • @MB-pt8hi
    @MB-pt8hi 7 лет назад

    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?

  • @MisterThug187
    @MisterThug187 5 лет назад

    Great Job my Friend

  • @Diegoad1
    @Diegoad1 Год назад

    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

  • @papercut197
    @papercut197 6 лет назад

    Wonderful Video. Thank you for posting it!

  • @sleepysundaymorning5034
    @sleepysundaymorning5034 6 лет назад

    The action implementation can be both done through method of View Model, or through the command itself.

    • @ToskersCorner
      @ToskersCorner  6 лет назад +1

      You are correct. And that is shown in part 2! -- i believe, it has been a while.

    • @sleepysundaymorning5034
      @sleepysundaymorning5034 6 лет назад

      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?

    • @ToskersCorner
      @ToskersCorner  6 лет назад

      @@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.

    • @sleepysundaymorning5034
      @sleepysundaymorning5034 6 лет назад

      @@ToskersCorner ill just text you my problem, and as you want you may answer it

    • @sleepysundaymorning5034
      @sleepysundaymorning5034 6 лет назад

      @@ToskersCorner youtu.be/addme/MIQcMcwgaA4aKIVSY4uLeHXLQf7Row invitation link to chat

  • @devall4324
    @devall4324 6 лет назад +1

    Merci beaucoup pour cette video

  • @wasdw246
    @wasdw246 8 лет назад

    I realize I'm in way over my depth. Thanks for making the video by the way :)

    • @ToskersCorner
      @ToskersCorner  8 лет назад

      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!

  • @alcidesneto6415
    @alcidesneto6415 2 года назад

    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.

  • @imaginative-monkey
    @imaginative-monkey 5 лет назад +4

    I wish the source code was available on github, the link doesn't work.
    Great video, thank you! :-)

  • @smarttransport7100
    @smarttransport7100 5 лет назад

    You're the best Bro

  • @shaihulud4515
    @shaihulud4515 4 года назад

    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!!!

    • @ToskersCorner
      @ToskersCorner  4 года назад

      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.

  • @matheuscastrosilva1632
    @matheuscastrosilva1632 5 лет назад

    Hi, How can I fire the CanExecuteChanged event from my ViewModel?

  • @EK-ck2xf
    @EK-ck2xf 6 лет назад

    Really useful. Many thanks

  • @abinashbaral3266
    @abinashbaral3266 6 лет назад

    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.

  • @lazermajor7908
    @lazermajor7908 4 года назад

    how and where does public void Execute(object parameter) get called?

  • @vincentbarrilliot9777
    @vincentbarrilliot9777 6 лет назад

    was quite useful, thanks!

  • @_emed84
    @_emed84 7 лет назад

    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.

    • @ToskersCorner
      @ToskersCorner  7 лет назад +2

      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!

    • @_emed84
      @_emed84 7 лет назад

      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!

    • @ToskersCorner
      @ToskersCorner  7 лет назад

      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

  • @Jwhite1979
    @Jwhite1979 3 года назад

    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.

  • @AkshayKumarTK
    @AkshayKumarTK 5 лет назад

    The code download link is dead

  • @User_Masuri
    @User_Masuri 5 лет назад

    This is so great!!!!!! :)

  • @abijo5052
    @abijo5052 7 лет назад

    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

    • @ToskersCorner
      @ToskersCorner  7 лет назад

      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.

  • @E7YSIAN
    @E7YSIAN 6 лет назад +1

    Absolute legend!

  • @siri7043
    @siri7043 4 года назад

    hi please upload a video to export datagrid to excel file in wpf mvvm

  • @icstrimterror
    @icstrimterror 8 лет назад

    Thanks for the video(s)!

  • @cyukore1796
    @cyukore1796 7 лет назад

    Nice tutorial

  • @amadlover
    @amadlover 5 лет назад

    buckling springs ?

  • @MultiMChelper
    @MultiMChelper 6 лет назад

    Thank you so much!

  • @sleepysundaymorning5034
    @sleepysundaymorning5034 6 лет назад

    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

    • @ToskersCorner
      @ToskersCorner  6 лет назад

      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.

  • @ABsazerNer
    @ABsazerNer 5 лет назад +3

    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 😫

  • @juanclopgar97
    @juanclopgar97 4 года назад

    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)

  • @sza1940
    @sza1940 4 года назад

    At 11:43 like you do not have 20 seconds for an "in a nutshell" explanation... Low effort video

    • @ToskersCorner
      @ToskersCorner  4 года назад

      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.

  • @stevehoff
    @stevehoff 2 года назад

    Couldn't watch more that 20 seconds after you opened visual studio. Your keyboard is beyond annoying.