C# WPF Tutorial #24 - Using RelayCommand in MVVM

Поделиться
HTML-код
  • Опубликовано: 6 июн 2024
  • Continuing to implement the MVVM pattern, adding RelayCommands so that we an bind our button commands to actions in our view models!
    Happy Coding!
    Chapters:
    0:00 Setup
    0:37 Button Command Binding
    1:00 Implementing ICommand (RelayCommand)
    4:25 Using RelayCommand
    6:00 Using Predicates (CanExecute)
    8:40 Recap & Tips
    9:20 Next Up
  • НаукаНаука

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

  • @IvisibleCat
    @IvisibleCat Год назад +49

    Please!!! dont stop with this series. I can learn a lot about WPF with your videos.

    • @KampaPlays
      @KampaPlays  11 месяцев назад +17

      Thanks so much! I will be back at it soon, still playing a bit of catch up at work.

    • @IvisibleCat
      @IvisibleCat 11 месяцев назад +2

      @@KampaPlays Nice to hear! :)

    • @elasdebastos235
      @elasdebastos235 2 месяца назад

      yes please

    • @MrLesBerg
      @MrLesBerg 2 дня назад

      @@KampaPlays Thanks for the videos! I haven't coded in C#/.NET since 2010 and I need to make a tool to work with multiple json files....
      Not only has the refresher been good, but a lot has changed since then.
      I have to build an app that uses 39 json "loot table" files that are all different and create a UI that allows users to edit the files in an understandable manner, then save them again so they can be used by a multiplayer game.
      Not only do I not have any control over the file format, none of the files contain a complete listing of everything that _can_ exist in them. Since a person can use the tool/app to completely keep an item from spawning in-game (a specifically requested feature) would prevent them from adding it back, one of the tasks I have is figuring out how to combine the "default" files into a master 'database'. I _also_ have to collect the various values of the properties in the files as those could be lost as well.
      So not only do I need to figure out how to build a single reader that can interpret all the files (that will also hopefully work with future versions of said files), I need to implement a configuration file and a local data file that contains all the possible things, places, and categories (all just different values of 'Name'), rarity values, etc.
      LOL, then I have to be able to spit it all back out into 39 modified .json files and I don't even know if making structural changes to the files will keep them from working. I know I can add/remove certain levels of child nodes, but the position of those specific child nodes changes from file to file...

  • @flacuchentxox3129
    @flacuchentxox3129 День назад

    You have no idea how much you saved me. I applied for a JavaScript job, but they recently wanted me to make a Windows application using WPF. It's very different. I had no idea about MVVM and data bindings. Your videos helped me a lot with building the base of knowledge in WPF, and even after 5 months, I still come here to relearn some stuff because you are the only one who explains things well, at least for me. Your videos are mostly basic stuff, but VERY essential. I appreciate all your work in making these videos. Greetings from Chile.

  • @user-xf7dn4jt7w
    @user-xf7dn4jt7w 3 месяца назад +9

    Thank you so much for this series. Many people around the world is watching this series even now.

  • @BryanDouglas44
    @BryanDouglas44 2 месяца назад +5

    Extremely helpful series. Thank you so much for putting these on RUclips. Like others on here, I hope to see this series continue.

    • @KampaPlays
      @KampaPlays  Месяц назад +2

      Thanks so much. Hope to continue soon!

    • @hanzhang4592
      @hanzhang4592 25 дней назад

      @@KampaPlays Lets go!

  • @hotbreadloaf6009
    @hotbreadloaf6009 4 месяца назад +7

    Nothing but praise to this amazing series! I really hope work/life slows down a bit so you can continue these awesome tutorials.

    • @AhmetYigiter
      @AhmetYigiter 4 месяца назад +1

      Yes, absolutely 💯

    • @KampaPlays
      @KampaPlays  3 месяца назад +4

      Thanks so much. I'm thinking (and hoping) that I will have enough time to really get back at it by late spring.

  • @EllieB-K
    @EllieB-K 11 месяцев назад +17

    Honestly the best tutorial on WPF so far! You rock!

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

      Thanks so much!

    • @Ferd_Learning-sw8ny
      @Ferd_Learning-sw8ny 4 месяца назад

      I agree, good and short videos, better than some very long videos

  • @floriandraxler3868
    @floriandraxler3868 2 месяца назад +2

    Very simple up to the point video that is suitable for me as a beginner thank you

  • @baldgeek1
    @baldgeek1 2 месяца назад +3

    It would be great if you contiued this series. I'm an old school coder starting to learn these new fangled ways of doing things. Your tutorials have helped!

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

      Hopefully soon, very glad to have helped!

  • @crackedboy701
    @crackedboy701 10 месяцев назад +4

    i just finished watching this video. can't wait to watch the next video. please continue making this series i've learned a lot from this series and i thank you very much for it.

    • @KampaPlays
      @KampaPlays  10 месяцев назад +1

      Thanks so much! Will do.

  • @latinchakma9725
    @latinchakma9725 3 месяца назад +5

    I have been loving these tutorials!

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

      Awesome, thank you!

  • @Pelleplop
    @Pelleplop 2 месяца назад +2

    The best WPF tutorial out there!!!! A huge thank you for creating this! As a self learner I'm really looking forward to the next episodes. 😃

  • @highestdremas7654
    @highestdremas7654 Год назад +6

    man this tutorial is crazy good, you just got a subscriber, Please update the course weekly

    • @KampaPlays
      @KampaPlays  Год назад +2

      Thanks so much! I try to do one/week, but lately and for probably a couple more months, work is slowing me down a bit, but I'm still at it!

  • @triadicbus4908
    @triadicbus4908 11 месяцев назад +2

    Just started using WPF and this is by far the best tutorial ive found. Subbed for future stuff.

  • @user-bh7is8lo7r
    @user-bh7is8lo7r 11 месяцев назад +3

    "Wow, your tutorial videos are absolutely amazing! The best one I can say from all the turorials I have checked. I can see your passion for teaching. Even with the small details. Your tutorials have been instrumental in helping me as a starter. Thank you for sharing your knowledge. Keep up the fantastic work!"

    • @KampaPlays
      @KampaPlays  11 месяцев назад

      Thanks so much, I really appreciate it and am glad they have helped!

  • @janbjorkenfjall1289
    @janbjorkenfjall1289 4 месяца назад +2

    Thank you for these amazingly good tutorials. The best I've found. I do hope you will keep doing them.

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

      Thanks so much, I'm hoping to be able to have time to get back to them by late spring.

  • @kisjoke91
    @kisjoke91 4 месяца назад +2

    I enjoyed watching this little crash course, the topics you selected are covering everything needed for a starter project. Thank you for your time you have been putting into this series.

    • @KampaPlays
      @KampaPlays  4 месяца назад

      Awesome, thanks so much!

    • @mkmerlinyt
      @mkmerlinyt 4 месяца назад

      Can't wait to see more. Please don't stop publishing and if you have more bring it on the table!!! :-)

  • @Foxe92
    @Foxe92 10 месяцев назад +2

    Just wanted to say, these videos are fantastic! Can't wait for the next one!

    • @KampaPlays
      @KampaPlays  10 месяцев назад +1

      Thanks so much, will be jumping back in soon!

  • @VijayalakshmiS-ck8jj
    @VijayalakshmiS-ck8jj 6 месяцев назад +1

    This tutorial really encouraged me to learn more on WPF! You are doing great job, waiting for the upcoming series!

    • @KampaPlays
      @KampaPlays  5 месяцев назад

      That's great, thank you!

  • @AlcacerHoldings
    @AlcacerHoldings 6 месяцев назад +1

    So glad I came across your channel...
    Haven't understood C# and Wpf so easily as I do now...
    Will surely be waiting for more videos
    Thanks a lot

    • @KampaPlays
      @KampaPlays  6 месяцев назад

      Thank you. Very glad to help!!

  • @greatooau
    @greatooau 10 месяцев назад +1

    Loved your series :), it's the best WPF series i've found on YT

    • @KampaPlays
      @KampaPlays  10 месяцев назад +1

      Thanks so much!!!

  • @chicksterossdy
    @chicksterossdy 10 месяцев назад +2

    I learned so much from this series that I can now apply to my homework :D Thanks man, keep it coming!!

    • @KampaPlays
      @KampaPlays  10 месяцев назад

      Awesome!! Thanks!

  • @thesm9734
    @thesm9734 6 месяцев назад +1

    BEST TUTORIAL EVER on WPF !!!! I have a subscription on LinkedIn Learning, but not even they could teach me as much as you did. Thanks a lot!

    • @KampaPlays
      @KampaPlays  5 месяцев назад

      Awesome, thank you so much!

  • @shir00didi
    @shir00didi 11 месяцев назад +2

    Thank you a lot for making this WPF tutorial, very concise and helpful! Waiting for the next video :)

    • @KampaPlays
      @KampaPlays  11 месяцев назад

      Thanks so much. Hopefully I'll be back at it soon!

  • @fRiTZL0NE
    @fRiTZL0NE 4 месяца назад +2

    3 plurasights courses just to understand what the commands are good for, took you 6 min to explain. Well done and thanks!

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

      Thanks, glad to help!

  • @user-fh3sr2lr2x
    @user-fh3sr2lr2x 8 месяцев назад +1

    I am waiting for your next youtube series about WPF. It was so good time to step here with you. I am touched. Thanks a lot~~!

  • @shayansohail9503
    @shayansohail9503 10 месяцев назад +1

    Wow, you provide verys simple explanation to seemingly complex topics, Thanks

    • @KampaPlays
      @KampaPlays  10 месяцев назад

      Really appreciate that!!

  • @Jacke500
    @Jacke500 8 месяцев назад +1

    love it, every word you say actually has meaning to it

  • @isakjones5836
    @isakjones5836 2 месяца назад +1

    Your tutorials are amazing! Hopefully your work slows down so you can keep these up because they have helped me immensely!

  • @dm-oz9yd
    @dm-oz9yd 11 месяцев назад +1

    Excellent. Exactly what I was looking for.

  • @laszlopallag7495
    @laszlopallag7495 7 месяцев назад +2

    Hi! Software engeneer in my final semester here!
    I just finised your series, and i must thank you, because it really helped me a lot. I had a lot of stress towards coding because i found it challanging and scary after my past experiences with it, and i was at a point where it easily gave me panic attacks to open a Visual Studio. I really thought that Software engeneering is not for me, but was scared to change majors this late. I not only learned from your series, but with your style of teaching, i got used to concepts and functions in coding, and i am proud and thankfull to say that i no longer have fear towards programming, i just need to learn more about it, and get familiar with it. This is all thanks to you, and how you introduce everything in this series, in a way thats understandable, short, and yet helps me to see how it would work in real life. If you continue this series, i'll keep following it, since it's the best one i have ever seen (And belive me, i watched a lot of 2+hour tutorials). But if not, for whatever reason, i still want you to know that your efforts in these videos saved my future carrier. Thank you!

    • @KampaPlays
      @KampaPlays  6 месяцев назад +1

      This is amazing. Thank you for writing, it means a lot.
      Great job powering through, it will pay off!! It's easy to get overwhelmed in this world, even for people doing it for many years. Just remember that the computer does only what you tell it to do, and take it one line at a time! :)
      Work(s) have been busy but I will be continuing as soon as I can.
      I wish you the best; thanks again!

  • @sadaqat4728
    @sadaqat4728 6 месяцев назад +1

    Hi @kampaplays , thank you very much for this detailed and to the point tutorial. I have no previous knowledge in wpf and I had an interview in coming week. I am following your tutorial to be prepared for the interview and its very helpful.

    • @KampaPlays
      @KampaPlays  6 месяцев назад

      Great job getting prepared, I hope your interview goes well!
      If you think about, let me know how it goes!

  • @user-fn7wt5bd1w
    @user-fn7wt5bd1w 8 месяцев назад +1

    You are amazing and i love your tutorials from Egypt

  • @athiraanilkumar887
    @athiraanilkumar887 3 месяца назад +1

    The content is really good and how you explained everything is so clear and understandable. I felt that you have covered most of the stuff needed for a beginner in WPF. So far the best WPF tutorial I've seen. I have a request, can you please make a video on using Telerik in WPF applications.

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

      Appreciate that! Do you have any specific wishes for Telerik controls or just how to incorporate the library, etc?

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

    Ty. I love your videos

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

      Thanks so much, I'm very glad its helpful! Will be back at it soon.

  • @pustehuseynova8326
    @pustehuseynova8326 Год назад +1

    Very nice video as always👍🏻👍🏻. I have learned a lot of things with the help of your videos. My dream was always to be a good programmer. With your help I hope I will achieve my purpose.

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

      Thank you!! I'm glad they are helpful. Keep at it, the best way to be a coder is to write code!! 😁

  • @M3rtyville
    @M3rtyville 7 месяцев назад

    I started my internship 4 weeks ago and got to work with WPF the first time there. Not much was explained and it looked simple enough to work with. It went well until I got stuck on a problem and no matter what I looked at, I didn't get what i needed. So I decided to watch your videos which made me understand how WPF actually works.
    I fixed my code a bit and customized it a little cosmeticly.
    Just can't get the styles to work for some reason which I would have liked to get rid of some redundant code.
    However, I still didn't manage to solve an issue.
    What my program does right now is that it has 3 textboxes, a button and a datagrid. 3 are reading the input and 1 of the text boxes uses 2 inputs to calculate something using those values and show it on the one of the textboxes. Everytime I change the parameters and click the button, it shows a new value.
    Now I want the Datagrid to do the same but instead of just showing 1 solution, it suppose to show 25 different solutions. I want to create a table that gets generated whenever the button is pressed just like the 3rd textbox does and change whenever I change parameters and click the button. First column suppose to show the numbers 1 to 25 and the second column calculate using the parameters from the first 2 textboxes times the value of the first column that is in the same row.
    That is the major thing I am stuck right now.

    • @KampaPlays
      @KampaPlays  6 месяцев назад +1

      You will likely need to bind some ObservableCollection type to your dataGrid and from there create and populate your data so it displays correctly. I don't have anything specific to that yet - but this may be helpful if you are still having issues. (sorry for my delayed response)
      stackoverflow.com/questions/24539022/how-to-bind-wpf-datagrid-to-observablecollection

  • @DavidDanosTech
    @DavidDanosTech 9 месяцев назад +1

    Congratulations Excellent tutorial. 🔥🔥🔥🔥🔥🔥🔥🔥🔥

  • @TauwinKul
    @TauwinKul 7 месяцев назад +1

    Thanks for your videos!

    • @KampaPlays
      @KampaPlays  6 месяцев назад

      Glad to help, thank you for watching!

  • @jerrybirmingham7536
    @jerrybirmingham7536 5 месяцев назад +1

    Wow, great series
    I'm in my 50s now, and I've been working with Excel for years (as a "hobbyist"). Someone where I work created an ordering form (in Excel). Its structure and performance really offended me, so I had to fix it😃. And I did (from home) problem was I had a newer version then they had at work and I didn't want to do the crazy (unnecessary) work to make my form work in their older version.
    I've played with C# in the past (for an Arduino project) and had a lot of fun doing it. So, I started on a quest to see what I could do with that. Then I found you and WPF 😁. True, I don't fully understand everything, but I am getting the hang of things a little at a time 😄.
    I really enjoy coding but I think I'm a little to old now to be jumping careers 😪(this stuff is crazy intense 😮 sometimes) but I thank you for making your videos it's been fun trying to" play with something new (at least new to me). I can't wait to continue working on different/new projects with you
    Thank you, and I wish you well 😃

    • @KampaPlays
      @KampaPlays  5 месяцев назад

      Excellent!! You sound like a software engineer to me, especially getting offended at structure and performance! 🤣
      Keep at it, and even if you don't want to leave your current job, there's tons of remote/freelance gigs out there if you want to turn your tinkering into dollars!

  • @callmejobson
    @callmejobson 8 месяцев назад +1

    Great series I need a refresher for my notes Thank you!
    -Jobson

    • @KampaPlays
      @KampaPlays  8 месяцев назад

      Thanks so much, glad it helped!

  • @RaqiGirl
    @RaqiGirl 3 месяца назад +1

    I have really enjoyed your C# WPF Tutorials. I feel like I've learned a great deal from them. I am wondering if you have, or can recommend, tutorials for accessing SQL databases? Thanx

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

      That was quick! So glad you enjoyed them. I don't have any video tutorial references on hand - I really want to do a series on databases when I have more time.
      Browsing around, I found this, it looks like it covers the important no-frills howtos of C# + MSSQLServer: zetcode.com/csharp/sqlserver/
      I think learning this is most important, rather than starting with an ORM like entity framework that obfuscates how things happen. Many times a simple database application, especially a personal one, is easier to just implement yourself rather than take on the extra complexity.
      From there, if you are interested, you might want to check out additional tools/ORMs like:
      Dapper: www.learndapper.com/#what-does-dapper-do
      Entity Framework: learn.microsoft.com/en-us/visualstudio/data-tools/create-a-simple-data-application-with-wpf-and-entity-framework-6?view=vs-2022
      If you are looking for a lighter-weight database option, SQLite [flat file, non-server] may interest you. sqldocs.org/sqlite/c-sharp-sqlite/

  • @jaimeandrescatano
    @jaimeandrescatano 9 месяцев назад +1

    Can't wait for the next one!!!!

    • @KampaPlays
      @KampaPlays  9 месяцев назад +1

      Thank you, hopefully I should be back at it soon!

  • @shivaprasad7703
    @shivaprasad7703 7 месяцев назад +1

    Waiting For Multithreading....Please continue doing video's...

  • @mertgulsen7284
    @mertgulsen7284 2 месяца назад +1

    Excellent tutorial

  • @christoflindner7335
    @christoflindner7335 2 месяца назад +1

    Hey, I'm so new to this channel, just needed some help in general with wpf, since im trying to develop a linrary for custom controls 😅...
    Thanks for all the help ... But gimme more 😂❤

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

      Good luck on the library!! Hopefully I'll be starting back up soon, too.

  • @gogoback-cb6sz
    @gogoback-cb6sz 16 дней назад

    the best tutorial!!!

  • @HobTechTV
    @HobTechTV 9 месяцев назад +1

    you deserve more subs, keep up the good work!!!

  • @peri.platypus
    @peri.platypus 6 месяцев назад +1

    new subscriber here

  • @ReallyUNeed
    @ReallyUNeed 10 месяцев назад +1

    It's great u point small things as well which creates confusions, keep it up like this...
    When is the next video eagerly waiting.
    Hope Coming Soon ends Soon.

    • @KampaPlays
      @KampaPlays  10 месяцев назад

      Thank you! I hope to get back to it in the next couple of weeks or so once work calms down.

  • @atalayk9663
    @atalayk9663 5 месяцев назад +1

    congratz. good job

  • @user-qq6qi1js6b
    @user-qq6qi1js6b Год назад +4

    Interesting video like the previous ones. Can you make a video on how to navigate between pages in wpf?

    • @KampaPlays
      @KampaPlays  Год назад +3

      It is on my to-do list! thanks!

  • @CrewDeNegro
    @CrewDeNegro Месяц назад +1

    awesome !!

  • @pierrestcergues
    @pierrestcergues 5 месяцев назад +1

    The coming soon next episode is wanted! :-)

  • @janjanlara2502
    @janjanlara2502 8 месяцев назад +1

    Wow plz don't stop this series specially WPF MVVM, can you make a content that create a project using C# WPF MVVM pattern?

    • @KampaPlays
      @KampaPlays  7 месяцев назад +2

      I'll be continuing the series, I will try to start from the ground up to create a whole project.

    • @janjanlara2502
      @janjanlara2502 7 месяцев назад

      @@KampaPlays thank you so much, well appreciated

  • @veczz2509
    @veczz2509 28 дней назад

    Legend thanks

  • @janvokurka2401
    @janvokurka2401 Год назад +2

    Great tutorials. Are you planning on making a video on how to navigate between pages/UserControls/Windows and its differences using MVVM and Commands anytime in the near future?
    Would really appreciate someone to explain this in another way than hour long non-commmented recordings :-)

    • @KampaPlays
      @KampaPlays  Год назад +2

      Thanks, yes navigation and swapping between views/viewmodels are both on my todo list!

    • @programwithdenis3643
      @programwithdenis3643 8 месяцев назад

      @@KampaPlays will be waiting

  • @JMCiller
    @JMCiller 7 месяцев назад

    Hey @KampaPlays thank you so much for this tutorial. I hope you can get back to it because I saw in the comments that it is helping so much people around the globe. I already saw many tutorials on RUclips and Udemy and I could not find anyone as good as yours. Congratulations for that.
    One suggestion that I have, will you continue with MVVM showing samples about passing data from one page to another page? and if you get back to that previous page, the data inserted remain? I could not find any tutorial explaining that yet on the internet and it will help me so much.
    Last question, I noticed trhat you always create WPF Windows and most people create from User Control. Whats the difference?
    Thank you so much master!

    • @KampaPlays
      @KampaPlays  6 месяцев назад

      Sorry for the delay.. really appreciate the thoughts!
      I will definitely make a deeper look with navigation and data passing/persistence. Many times it can be as easy as maintaining references to your active views' view models, and the data will be held in those objects, but it's close up on my todo list when i can get back into it.
      Usually for these tutorials I just create a single Window and put logic into it. Window comes with behaviors to start/close the application as well as minimize/maximize/etc. User Control is basically UI space with nothing extra, so its great for separating out pieces, creating reusable widgets, swapping panels, etc.

  • @balintmolnar9064
    @balintmolnar9064 5 месяцев назад +3

    Thanks

    • @KampaPlays
      @KampaPlays  5 месяцев назад +1

      Thank you, really appreciate that!!

  • @BadyTheProgram
    @BadyTheProgram Год назад +1

    Nice tutorial series, I learned a lot. I am a beginner in WPF o maybe my question is basic: do you plan to make tutorial about how to add and remove elements/uer controls from grid or other elements like stackpanel? I thinnking about like miniatures appear in the windows explorer.

    • @KampaPlays
      @KampaPlays  Год назад +1

      Thank you, I'm glad it was helpful. I can add this to my todo list!

  • @rmunhozdev
    @rmunhozdev 7 часов назад

    Great. Where Can I find the sources of this playlist?

  • @khuebui7087
    @khuebui7087 8 месяцев назад +1

    thanks for sharing, can i ask a question, in MVVM where i can call API or logic

    • @KampaPlays
      @KampaPlays  8 месяцев назад

      You would call API/logic inside of the ViewModel itself. That way you can use the results/response to update your UI and your models. You may want to separate the bulk of that logic into another class to be called from the ViewModel if it makes sense to do so.

  • @mohanty_rahul
    @mohanty_rahul 2 месяца назад +1

    very nice video playlist
    is there any chance for more videos for WPF?😀

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

      Thank you, hopefully soon!

  • @dariostromajer1625
    @dariostromajer1625 Год назад +1

    Great video as always. If there aren't any major downsides to it, I think I'll just go with implementing each command as a separate class since I have absolutely no clue how lambda expressions work or whatever that was you used...

    • @KampaPlays
      @KampaPlays  Год назад +2

      Thanks!
      I would strongly recommend using the generic version of the RelayCommand class. It will keep you from ending up with hundreds of lines of duplicated code, and if changes ever need to be made, they can be done in a single place. Expression bodied members are a bit crazy looking at first, but they are an amazing tool in C# I and definitely think it's worth learning!
      learn.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/expression-bodied-members

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

      @@KampaPlays That's interesting because I saw this video: ruclips.net/video/bYPU8X8f2xU/видео.html (this is his conclusion) from a seemingly experienced guy, who is also making wpf tutorials. He talks about the pros and cons of creating a class for each command and he also presents an example in which using relay commands would actually result in duplicated code. So I got the impression that it doesn't really matter which way to do it... I'll definitely still look into expression bodied members though!

    • @KampaPlays
      @KampaPlays  Год назад +2

      @@dariostromajer1625 Hey, that was a good watch, and a pretty clean way to do things. I wasn't trying to say it was wrong, but mostly that I would give it a go (especially with expression bodied members themselves) before you go with the other method. I've used both methods with success, but what I've noticed is with a team of people, things can get much muddier faster with command specific implementations, but as long as you follow a good standard and keep consistent I say do what you are comfortable with.

  • @lukas6538
    @lukas6538 14 дней назад

    Does this also work for events?

  • @najlitarvan921
    @najlitarvan921 24 дня назад

    could you do a tutorial on how can two user controls communicate between each other and dynamically replacing parts of the ui based on what is say selected in a tree view or datagrid

  • @kfpcraft531
    @kfpcraft531 14 дней назад

    It's so sad that Kampa Plays did not make the multi-threading video. I would use that video.

  • @evanmashack8242
    @evanmashack8242 5 месяцев назад

    Any suggestions on books or other resources to continue to learn WPF?

    • @KampaPlays
      @KampaPlays  5 месяцев назад +1

      My biggest suggestion would be to pick a personal/work project you want to complete and let necessity drive your learning using the Microsoft available resources. learn.microsoft.com/en-us/dotnet/desktop/wpf/controls is a good place to start, they have lots of information for each component including sample code and examples.

  • @onstargaming3168
    @onstargaming3168 4 месяца назад +1

    Hey do you know
    How can we get wpf in macOS
    It is not showing wpf in it
    I want to know is there anything specific I have to do or there is alternative
    I am really into it and I have MacBook

    • @KampaPlays
      @KampaPlays  4 месяца назад +1

      As far as I know, WPF is strictly Windows. There are several WPF-like alternatives that are cross platform though. Check out Avalonia UI. MAUI also is similar, in that it uses XAML, but Avalonia is much closer to native WPF.

  • @benstrahd3154
    @benstrahd3154 Год назад +2

    Great tutorial. Can you make a video for mvvm community toolkit as well?

    • @KampaPlays
      @KampaPlays  Год назад +1

      Thank you. I'll add this to my list, but it may be some time before I get to covering any specific 3rd party packages.

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

    Great tutorial! but I just want to know, if Is it possible and if so, how can I change the SelectedItem to SelectedItems so I could remove multiple rows at once. 😁

    • @KampaPlays
      @KampaPlays  Год назад +1

      Thank you!! It is possible, but since you can't bind directly to SelectedItems, you have to use another way such as a CommandParameter or custom control. I will add this to my to-dos!
      This might help clear things up in the meantime: stackoverflow.com/questions/9880589/bind-to-selecteditems-from-datagrid-or-listbox-in-mvvm

  • @ilikewaffles3689
    @ilikewaffles3689 10 месяцев назад

    Every other video on the WPF playlist was crystal clear. This one was very confusing. Maybe it will be clearer if I look into what commands are in WPF controls.
    I understand expresion-bodied members, but don't understand the purpose of providing Action and Func to the Interface's methods.

    • @KampaPlays
      @KampaPlays  10 месяцев назад +1

      Sorry for the confusion -- WPF bindings and commands are one of the more "black magic" things that are hard to see how they work.
      Those parameters are provided so you can make RelayCommand more generic. You can pass any function to serve as your command action, and any function to serve as your predicate (whether or not you can do that action).
      So for example, using a button, you can bind a RelayCommand, and provide a "DoThis()" and a "CanDoThis()", and it will handle things like disabling the button based on "CanDoThis()" to running "DoThis()" when the button is clicked.
      I hope this is helpful.

    • @ilikewaffles3689
      @ilikewaffles3689 10 месяцев назад

      @@KampaPlays yes I think I understand. What's the alternative? Do you create a new class with new methods for each button?

  • @user-vg1ft2qf5i
    @user-vg1ft2qf5i Год назад +1

    If I have a method that takes a parameter to perform a task based on the parameter, how would I include a CommandParameter to the command?
    Thanks for the great tutorial. It helps me a lot.

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

      Are you asking how you can pass something to the Execute method of your command? If so, you can set the property CommandParameter on your button in xaml. You can also do it in code-behind with yourButtonName.CommandParameter = something...

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

      Thank you! Dario's answer is correct, and I will add these to my todo list, as it can be confusing!

  • @kevingenon5904
    @kevingenon5904 9 месяцев назад +1

    please make more!

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

      Will be back at it as soon as work calms down a bit!!

  • @samotrasin6
    @samotrasin6 3 месяца назад +1

    please continue...

  • @2206lars
    @2206lars 22 дня назад

    Amazing tutorial!!!
    But can anyone tell me if / how i can pass augments (CommandParameter or simillar) to the Relay Command?

    • @2206lars
      @2206lars 22 дня назад

      Got it :D
      In Viewmodel:
      public ICommand delIng { get { return new RelayCommand(param => deleteIng(param)); } }
      void deleteIng(object ing)
      {
      //Do sth
      }

  • @vladimirruppel
    @vladimirruppel 4 месяца назад +1

    Hello! Watched already all your videos about WPF and want to say thank you for the job you've done!
    Although in the end of the video you're telling that a video about threading is coming soon but this is the last video. What happened? :(

    • @KampaPlays
      @KampaPlays  4 месяца назад +1

      Appreciate it. Yeaaaah, life happened. Lots of work and family things. I am planning to return as soon as I can with a continuation of the series and advanced topics, but I have to get past a few more hurdles first! Thanks for watching :)

    • @vladimirruppel
      @vladimirruppel 4 месяца назад +1

      @@KampaPlays damn, hang in there!

  • @reyaadelkomy8046
    @reyaadelkomy8046 Год назад +1

    Can you make a tutorial for communicating between two viewmodels, create an n-tier solution structure and work with EF. Thanks a lot!

  • @israraziz387
    @israraziz387 3 месяца назад +1

    More vedios on mvvm

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

    Can you make a tutorial on accessing data with EF Core on WPF ?

    • @KampaPlays
      @KampaPlays  Год назад +1

      Will add to my list of to-dos.

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

    Please teach how to handle different screen resolutions

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

      Many things in WPF "handle themselves" when it comes to resolution changes -- What are you interested in doing?

  • @ninasharma1356
    @ninasharma1356 9 месяцев назад +1

    Please make a tutorial on inkcanvas with infinite drag/scroll. Thanks 🙏

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

    Can you pls do video on tree view dynamic binding pls…

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

      This is on my todo list, thanks!

  • @ToastyB9
    @ToastyB9 Год назад +1

    Where is the code? If I am not finding any code with this video, it's a waste of time to follow your video.

    • @KampaPlays
      @KampaPlays  Год назад +2

      I don't include code with these short, beginner level tutorials. This is to help the most people learn and retain the information. The best way to learn to code is to write code.

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

      @@KampaPlays I have thirty years experience and just switched to WPF. I’d encourage you to include the code because people don’t have time to write code for these. I’m finding solutions elsewhere and now I look for code before viewing.

    • @KampaPlays
      @KampaPlays  Год назад +5

      @@talktodale I appreciate the feedback and definitely understand your point (I don't watch tutorial videos myself, as its faster for me to just reference the documentation).
      I will absolutely include repos for more complex/lengthy topics, but my primary goal here is to help people learn, understand, and retain. I would highly recommend going straight to Microsoft
      learn.microsoft.com/en-us/dotnet/desktop/wpf/
      and skip videos entirely if you are an experienced programmer, as it has a wealth of example code for everything you might need. Again, thanks for the feedback and best of luck to you.

  • @delunzhou4080
    @delunzhou4080 7 месяцев назад

    Can It get a job in cina?

    • @KampaPlays
      @KampaPlays  6 месяцев назад

      With remote programming jobs being so available, I bet you could get work anywhere! :)

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

    Hi Kampa, may i contact you per email?

    • @KampaPlays
      @KampaPlays  Год назад +4

      Sure -- kampaplays@gmail.com but honestly I don't check the mail as often as I check comments here!

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

      I d like to get professional support from you and i believe it wont take too much time from you. I already have an approach (basic solution) and would like to discuss you whether my solution is optional or acceptable. (I have a set of historical collection and i d like to filter based on filter text box (a string prompted by water watermark) i convert this string into column name and value pair and then filter this column by that value given by filter text box(ps. Orc filter control is used from wildgums)