Commands In WPF

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

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

  • @rahulgoutham7102
    @rahulgoutham7102 11 месяцев назад +1

    I feel that it is the best video to learn that explains the Commands in WPF. Thank you very much, Sir 🙏

  • @iXmerof
    @iXmerof 7 лет назад +6

    sometimes you're speaking too quickly, but I like how well organised is your speech here. Thank you for good explanation

  • @davesimon9192
    @davesimon9192 7 лет назад +4

    Good video.
    The only thing about mvvm I don't like is sometimes all of the additional classes and code compared to regular code behind can actually makes your code base more convoluted.

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

    Thank you for the video. Your video is very helpful but there is two things that i wanted to point out. 1-) You placed the logic on ViewModel, which shouldnt have any logic inside. 2-) By connecting the View model with logic inside to the xml, you have done nothing but pointing code behind(MainForm.cs) to ViewModel.cs. Thank you again for your time and efford.

  • @1ThomasTom
    @1ThomasTom 4 года назад +3

    Crystal clear! Thumbs up for this short clip.

  • @shobhamahadev118
    @shobhamahadev118 9 месяцев назад

    A best tutorial on RUclips on WPF. Please do add videos on concepts like how to implement icons, item templates, scrolling and adding behaviors etc.

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

    I don't understand your example with print command. Why should we write the code with codebehind page three times. I don't think anyone is doing it. You just write once a print function and just call it three times in the events in the code behind page. By using commands you also have to call the command three times, just not in the code behind page but in the binding of the view. Correct me if you have another opinion

  • @rohitherai962
    @rohitherai962 Месяц назад

    Too good
    can able to understand what command is

  • @sergeyt4118
    @sergeyt4118 5 лет назад +5

    This is a good example to illustrate my hesitation while I'm learning C# and .NET in general: I can see the author simplified the example to the best level possible, but I still can not comprehend as a generally logically thinking human beeing - why the hell the authors of this computer language made it so that to implement a simple thing one would reasonably hope to have done in a few lines of code and in just a few property settings hwere needed, it requires tens of lines of code, a number of entities and multi-level representation of the logically same thing (with repetition of entities like onion layers) ??
    whose sick mind could invent such a programming philosophy I keep wondering?
    To me its an ideal source of many mistakes and bugs a general piece of SW is notorious with, or when finally bug-fixed and tested ok than explains why it costs so much to develop software (when another programmer struggles to understand what the author meant to do here and there if not properly commented in the code or without documentation). Doesn't the general science rule (citation from Einstein or someone else?) state that the right thing should be short and clear.
    To me the code should better be longer in terms of lines but more humanly understandable, to hell with these multiple layers of abstraction:))
    Or what is this, a conspiracy? - make it difficult to understand for others and profit from your competitive advantage - artificially created logical constructs? :))

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

      HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH thank you, you truly made me laugh from the bottom of my heart XD

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

      It's not to make things harder. It's used to decouple UI from the business logic. And though for this easy MessageBox.Show he has so much overhead in this example, the overhead is static here. He will be able to reuse that (Relay)Command class (and possibly ViewModelBase class). It's a lot of overhead for a simple and small WPF application, but it's the opposite when the application comes enormous and you want to couple your logic to a different UI.
      The MVVM design pattern is honestly not that complicated, though i think the documentation of it by many people seems disorganised. Once you understand that INotifyPropertyChanged is simply an event in the Setter methods of properties that helps UI to know when to re-get the value of that property after it has been set to something else and that commands are really just a public delegate void (object) that you pass a function into and can call from your UI using

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

    Very well organised and simple to understand

  • @anulekhachatterjee
    @anulekhachatterjee 5 лет назад +2

    Extremely helpful videos. Thank You Sir!

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

    Thanks for uploading this video. I recreated all your steps in Visual Studio 2019 Community Edition successfully.

  • @maxron6514
    @maxron6514 2 года назад +2

    Outstanding explanation, it can’t get any better than this!

  • @chandranshugautam8070
    @chandranshugautam8070 2 года назад +1

    My question is how is it knowing that it has to execute that command on Click only. Why not on hover or anything else. We have not mentioned click anywhere??? Please help.

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

    Helped me alot to understand basic,
    than you so much.

  • @kimh.6680
    @kimh.6680 4 года назад +3

    I have a generic command that I've been using for years, which looks almost the same as yours. I wonder why Microsoft doesn't deliver this implementation instead of simply providing ICommand without any standard implementation.

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

    Thank you very much for your video, I have one question please , till now I can’t understand that, your command has als default Click event , can I build command working with other events? For example hover or any other event?
    Thank you so much

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

    Very useful lesson 👍 thank you

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

    Great tutorial tbh, the way you explained it made perfect sense. Thanks!

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

    Very Helpful and theory is really good.

  • @TT-ud5gf
    @TT-ud5gf 6 лет назад +1

    It seems that Command is for Button click use case. Should Slider, ComboBox... use Command to eliminate the code behind?

  • @gauravagarwal2460
    @gauravagarwal2460 7 лет назад +4

    you did not use the eventhandler "canExecuteChanged" anywhere...

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

    Very good tutorial.

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

    very thanks.. finally i understand view model...

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

    Thank you a lot you have the talent of explanation

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

    Thanks for the wonderful video, I understood MVVM concept and I did practical as well, my both class files are as like yours still, I am getting the error that my namespace does not find the class. i tried to solve several ways have not got any luck . would you please suggest any solution to cure this problem !!!

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

      You can set the Datacontext of the window from the UI using
      If you have your viewmodel in a folder then you could create a new xml namespace:
      xmlns:nameofchoice="clr-namespace:SolutionName.FolderName"

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

    very useful for beginners.Thank you so much.

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

    I have a "ViewModel" does not exist in the namespace "clr-namespace" error.

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

    excellent explaination of complex in easy way. I want to point out why canexecutemethod return true in both command class and viewmodel class.

  • @sanjuprajapati068
    @sanjuprajapati068 8 лет назад +3

    pls sharesome idea about RoutedCommand and difference between Relay and RoutedCommand..

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

    Hii Sir,
    Your videos are great to learn..
    But i have one doubt is that, how to copy observable collection to clipboard in WPF
    Please help

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

    I faced an error when trying to use
    it's saying: The name ViewModel does not exist in the clr-namespace:Sample

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

      I cleaned the solution and rebuild it, it got fixed ^^.

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

    Awesome Its very helpfull Thank You....

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

    Hi, I am new to WPF. Can somebody explain me how actually this code works. Not able to understand how executeMethod of ViewModel is executed.

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

    thank for giving a wonderful video on command

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

    we have not implemented EventHandler CanExecuteChanged... Why?

  • @viveksaurabh75
    @viveksaurabh75 7 лет назад +1

    HI good one...Can we get the vieo related to difference between ICommand and Routed Events ...and when to implement it..Please make a video for this

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

    Excelente explicación

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

    Hello, excellent video; Can you upload similar video in "Visual Basic" language applied in 2 or more windows?

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

    Thank you for explanation, Can you please make video how to hide fields on click of button/Radio button during runtime in MVVM

  • @Susandwyer
    @Susandwyer 3 месяца назад

    I just don't get commands, especially the claim that there is no code behind, and then proceed to write 2 full classes of code behind.
    So event = Add message box.
    And command = walk a mile and then add message box.

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

    Why we have not use data soure

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

    public ClickViewModel()
    {
    MyCommand = new OnclickCommand(ExecuteMethod, canExecuteMethod);
    }
    This, above parameter value pass error , how to resolve problem

  • @n.renukachowdary6057
    @n.renukachowdary6057 5 лет назад

    Please provide more examples wpf with mvvm

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

    When writing code in Codebehind page is very simple then why to use these many lines of coding just to call single click event?

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

      You are right in this simple case it's easier and quicker to write it into the CodeBehind of the View. But we are working towards understanding and using the MVVM pattern which is fundamentally the separation of the Business Logic code and the UI code. Perhaps you should re-watch the "MVVM Pattern in WPF" video again for the explanation of why we want to do this.

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

    Gracias.

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

    Can you please share the codes as well for the benfit of time

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

      Yes will share the same..

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

      @@dotnetskoool5809 great thx a lot . Tutorials are really awesome and simple

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

      where can i get the code. Did you get time to upload the code?

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

      Please check the video discription. Thanks

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

      @@dotnetskoool5809 : you nailed it thx for sharing.It saved lot of time

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

    AWESOME!!!!

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

    Error occures

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

      looks like class name you use view model instead of ViewModel

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

    Thanks!

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

    Thank you for helpful video.? for asking question to you ,can you share your email?