C# WPF - Relay/Delegate Commands [Part 2]

  Рет қаралды 33,872

ToskersCorner

ToskersCorner

Күн бұрын

Пікірлер: 67
@gard2054
@gard2054 2 ай бұрын
7 years later, and this is still hands down the best explanation out there
@shaikhzoyeb
@shaikhzoyeb 6 жыл бұрын
thanks for explaining beautifully , WPF is pain in the A** for beginner however after watching your tutorial i have got an idea how really binding and generic command binding works
@misters6451
@misters6451 6 жыл бұрын
Thank you man! I learned more about WPF from this video than a few days of reading some articles.
@uchitesting
@uchitesting 4 жыл бұрын
Same here. It's relieving.
4 жыл бұрын
Your video helped me a lot in one of my University projects. You're a GOD ❤️
@Vitorgasparete
@Vitorgasparete 2 жыл бұрын
Thanks very much! So Simple video thats helps me a lot. Another point is Im Brazilian and your english is easy to understand.
@mahmoudzeort7078
@mahmoudzeort7078 2 жыл бұрын
Excellent! the best videos explaining Icommand and commanding in WPF MVVM. Bravoooooooooo
@finch9668
@finch9668 6 жыл бұрын
You're so good. Wish there are more tutorials ~ thx
@ToskersCorner
@ToskersCorner 7 жыл бұрын
Did some excessive babbling in this one. Whoops! ;) Try running at 1.5x speed if you are impatient like me.
@crusaderzero3984
@crusaderzero3984 7 жыл бұрын
Good tutorial! The only thing I can suggest is that can you higher the volume of your microphone? The voice is too low for me to hear. BTW, I still have trouble to understand how the canExecuteChange event works? What's the purpose for using add & remove ComandManager.RequerySuggested +(-)=value?
@Jwhite1979
@Jwhite1979 3 жыл бұрын
1.5? Ha. Try .75, and I still watch it five times. Well done, friend.
@iancarr3923
@iancarr3923 3 жыл бұрын
Your delivery is just right for me. Thanks
@miloszodin
@miloszodin 7 жыл бұрын
As promised: even though I understand everything in this video, some questions arise unavoidably. "CommandManager" is only vaguely mentioned though it plays an important role here - as far as I understand. Adding some background to this would help people like me, know what are they looking at, and after the video what to google for. Also I've leaned that there is something like "Predicate" but not much more. I would like to know what is the benefit, how it is used and how it simplifies the solution. And about CanExecute - I wonder can it be structured as an universal solution for validating textboxes for value-binded-type (as I understand it's already a part of binding convenience) while also taking some additional parameters that expand it's capabilities (enable if: equal to 8 digits, not null or empty, only letters; and so on).
@uchitesting
@uchitesting 4 жыл бұрын
I can agree with you. I do not know either What a Predicate exactly is and I'm still curious to know more about this CommandManager thing and I'd like to know more. That said, the content of the video explains enough to understand and the aforementioned would need an extra research. What I mean is I come here to know about ICommand/ Commands in the context of WPF and I got what I need. The promise of the video is fulfilled. Should you need to understand what Predicate is, you need to take any course that provide the info. I can suggest you these links: www.tutorialsteacher.com/csharp/csharp-action-delegate www.tutorialsteacher.com/csharp/csharp-predicate I have not found more about the CommandManager myself so I can't help on that one. Best Regards.
@juanclopgar97
@juanclopgar97 4 жыл бұрын
@@uchitesting I don't know if I can help to you about Predicate delegate, or if you understand it, but I'm gonna try to explain it anyways. (Unfortunately you need a Delegate and Generic Types Background, If you want know more about that, tell me and I'm gonna try to record a video explaining that) a predicate is a Generic delegate type, it means that it can store a method with the next signature: Predicate myDelegate can store bool MyMethod(MyType parameter){...} Why Predicate exist??, well sometimes you need a common usage delegate for your applications, but most of the time that delegates have a common signature for example: void MyMethodTwo(){...} delegates that acept methods void, with or without parameters, the gold rule is, if exist a delegate to store your method USE IT DON'T Create one!!!!. for example, if you want store void MyMethodTwo(){...}, you can create your own delegate: public delegate void MyDelegateType(); In that whay you can do this: MyDelegateType storage = MyMethodTwo; but you don't need create a new delegate type because the framework provides you Action, that allow you store your method too. And about the 'in' modifier in the generic type... is completly other story, and very complicated hahahahaha. I hope this can help you :D
@andrejlicanin2419
@andrejlicanin2419 4 жыл бұрын
A suggestion: make a small diagram of what's going to happen in the video, and show it and explain before you start coding. It doesn't have to be anything special, just a bunch of squares and text, and draw some lines to show how it's going to relate. Or maybe you can do it at the end of a video when you recap.
@kritikyorumer
@kritikyorumer 2 жыл бұрын
So good. It is clearly, thank a lot! Man
@luisarias9682
@luisarias9682 Жыл бұрын
This was really helpful and got me to understand Relay Commands, Why do we check if the Action or Func are null? is that the same as checking if they are instantiated? one more question, why do we add the in the class declaration of Relay Command and what difference does it make?
@Vsod565
@Vsod565 4 жыл бұрын
Super useful video. Just a small suggestion: instead of passing "execute" into the ArgumentNullException, it's better to generalize by using nameof(execute)
@sixpetrov
@sixpetrov 6 жыл бұрын
Great tutorial, thank you. Although your keyboard is rather loud. Is it mechanical?
@CarloJS
@CarloJS 4 жыл бұрын
thanks for the awesome tutorial, you have gained a fan!
@mr.v7103
@mr.v7103 5 жыл бұрын
This was very educational for me.
@adalbertbiadatz4138
@adalbertbiadatz4138 2 жыл бұрын
Great tutorial!
@mateuszchrupczalski4247
@mateuszchrupczalski4247 3 жыл бұрын
Great video. Thanks for the explanation.
@juanclopgar97
@juanclopgar97 4 жыл бұрын
I understand ALL!! (almost :p) hahaahaha great videos!!!, I've just a question, What is 'CanExecuteChanged' event for???, and most importantly, Why are you storing the subscribers to 'CommandMannager' instead create a field to store that values?.
@santos5882
@santos5882 2 жыл бұрын
awesome tutorial
@nedelcugabriel7687
@nedelcugabriel7687 4 жыл бұрын
Hello! Can you give me an example of how to change views using Relay Commands?
@islamicuniversity8628
@islamicuniversity8628 6 жыл бұрын
Very nice tutorial for WPF, if you make the tutorial for Prism with WPF it would be great. Thanks
@shivaprasadmanchala3955
@shivaprasadmanchala3955 2 жыл бұрын
Can u give example with data grid with one checkbox column. Check all / Uncheck all. Thank you in advance
@GAGANDEEP901
@GAGANDEEP901 7 жыл бұрын
Very helpful, Thanks man!!
@ToskersCorner
@ToskersCorner 7 жыл бұрын
Awesome, it's always good to hear this. If you haven't already - there is a 5 question survey in the description I encourage people to take. It has you answer basic questions that can help me improve or hone in on the things you feel you liked/disliked about how I conducted the tutorial. Hope my videos continue to be helpful ;)
@warr39
@warr39 7 жыл бұрын
I did find it very useful, thank you very much!
@ToskersCorner
@ToskersCorner 7 жыл бұрын
+warr39 thanks for leaving a comment! Glad i helped!
@juanclopgar97
@juanclopgar97 4 жыл бұрын
Why when I press the buttons Logic are correct (Print when they have to print), but buttons are not disabled
@edpoitras420
@edpoitras420 2 ай бұрын
Can't get the Console.WriteLine to show up in the output screen- any suggestions?
@arjaymaligaya6272
@arjaymaligaya6272 4 жыл бұрын
How to use relay command in asynchronous methods
@hazemelamir2083
@hazemelamir2083 6 жыл бұрын
many thanks for your valuable lessons can you help me and make another video on how can passing more than one commandparameter & how can we pass parameter with our method
@ABsazerNer
@ABsazerNer 4 жыл бұрын
How beautiful is mvvm
@extremex5686
@extremex5686 5 жыл бұрын
I did not understand why console not worked in list control. please help me to understand this. btw Ty for this video :)
@rainerzufall1337
@rainerzufall1337 5 жыл бұрын
Because the ListBox object does not have a Text property. You need to set the path to SelectedValue instead. Then it works the same.
@shubhankjoshi7175
@shubhankjoshi7175 5 жыл бұрын
You are a god. Thank you!
@franklyndejesusmejia5907
@franklyndejesusmejia5907 6 жыл бұрын
Thank you so much!
@randypenajimenez3893
@randypenajimenez3893 5 жыл бұрын
Bro, where did you get that vs theme?
@BoyOfTheFuture4987
@BoyOfTheFuture4987 6 жыл бұрын
can you please explain the command manager thingy a bit more.....i am a but confused ..and how does the function canExecuteChanged gets executed if it is never called... and also the add{} and remove{} ..how do these work
@ToskersCorner
@ToskersCorner 6 жыл бұрын
This has to do with the behind the scenes mechanics of WPF. From my understanding, it is tied up to your CanExecuteEvent and with the command manager the event is updated on any possible changes that could affect the can execute state. For example, changing focus of controls. If you want to investigate, just try putting a break point somewhere in the can execute event or method. You will see with command manager this is called many times for many different reasons. Some of the reasons it calls can execute can be arbitrary and irrelevant, so it may be called even when nothing has changed the can execute state. Typically in more intense applications you would use a different method that calls it ONLY when the state changes. However in smaller applications such as the example, it has little negative affect on just calling it many times for 'possible' changes. Mor info can be found here, or other simple Google searches: stackoverflow.com/questions/6634777/what-is-the-actual-task-of-canexecutechanged-and-commandmanager-requerysuggested/6635324
@raviprasad2379
@raviprasad2379 7 жыл бұрын
Bro I usually use smartphone to see KZbin, and those who do the same they all face the problem as I am facing. Instead of covering entire screen while recording please zoom the coding window so that even in small screens we can see the videos without stressing our eyes.
@ToskersCorner
@ToskersCorner 7 жыл бұрын
Hey Ravi, thanks for commenting. I became aware of this a while after making my initial videos. Unfortunately older ones such as this do not zoom, though with my newer videos I am making do. If it is any help, the code for this episode is in the description. Perhaps at some point I may also re-upload some of my videos to be mobile friendly. Sorry for this inconvenience.
@raviprasad2379
@raviprasad2379 7 жыл бұрын
Thanks for the reply. You are doing a great job all your videos are easy to understand.
@ToskersCorner
@ToskersCorner 7 жыл бұрын
Hey, I uploaded a new review video and thought of you. I used a different method to zoom in and out of my code for the video. Let me know if this method is better for you on your smart phone! kzbin.info/www/bejne/Y3W8fqqMbtl0b8U
@raviprasad2379
@raviprasad2379 7 жыл бұрын
ToskersCorner Hi buddy, I am so happy because you did what you said and replied back. I went through the video compared to previous videos this I feel better but still I fell little zoom is required. What I feel is you can unpin solutions explorer while coding so you can zoom more and we can see better. If you don't mind give me your mail id I will send you the screen shot that I took from my phone Or you can only use your smart phone to see. My phone screen size is 5.
@ToskersCorner
@ToskersCorner 7 жыл бұрын
You can shoot me emails at toskerscorner@outlook.com !
@Ianuarius
@Ianuarius 3 жыл бұрын
You really seem to like Message Boxes.
@elenaking7377
@elenaking7377 3 жыл бұрын
Anyone know why he is inactive since 4 years?
@johnsailor3590
@johnsailor3590 6 жыл бұрын
C# is really complex
@ToskersCorner
@ToskersCorner 6 жыл бұрын
Anything is complex if it is new to you! Though these videos are intended for something a bit more advanced, are you very new to C# and programming in general? If so, how long?
@johnsailor3590
@johnsailor3590 6 жыл бұрын
ive been developing since 2015 but as web developer now im trying to get into desktop apps ( just for fun ), i really get it i mean i understand how it works but i dont like the excesive code to do a pretty simple stuff in WPF, i know we have winforms but idk ... i think i need to get into a big project to understand the because of the causes
@FollyOx
@FollyOx 6 жыл бұрын
IMO Just do videos about the title, i dont want to know about you app just how to use commands.
@ToskersCorner
@ToskersCorner 6 жыл бұрын
I agree, and I try not to go too far away, but sometimes the context is really important if you want to actually understand it and not just "copy/paste" the implementation. Can you give me an example time stamp in this video where you think I go off topic a little too much? (I see I mentioned this in an older comment, but I forget where in which I was referring)
@FollyOx
@FollyOx 6 жыл бұрын
I re-watched it at x1.25 and its fine, I was too harsh. Thank you for this video it was very useful resource
@CornelionSigismon
@CornelionSigismon 6 жыл бұрын
Very well done. Congrats!
@GAGANDEEP901
@GAGANDEEP901 7 жыл бұрын
Very helpful, Thanks man!!
XAML WPF - Styles Part 1, Window Resources
11:53
ToskersCorner
Рет қаралды 39 М.
C# WPF - Commands [Part 1 Intro + Singular Commands]
17:32
ToskersCorner
Рет қаралды 50 М.
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 262 #shorts
00:20
VAMPIRE DESTROYED GIRL???? 😱
00:56
INO
Рет қаралды 8 МЛН
Friends make memories together part 2  | Trà Đặng #short #bestfriend #bff #tiktok
00:18
C# WPF Tutorial - Using INotifyPropertyChanged
22:01
ToskersCorner
Рет қаралды 49 М.
WPF Commands Explained  [1 of 2 ]
28:14
Tactic Devs
Рет қаралды 8 М.
Minecraft’s Most Famous Map is Being STOLEN… by Microsoft...
16:57
Async Commands (and Async Relay Command) - EASY WPF (.NET CORE)
14:14
C# WPF Tutorial - Multiple Views
20:00
ToskersCorner
Рет қаралды 167 М.
C# WPF - IValueConverter Part 1
7:42
ToskersCorner
Рет қаралды 15 М.
Commands In WPF
20:34
DotNetSkoool
Рет қаралды 77 М.
Using the ICommand interface with parameters
12:56
Eduardo Rosas
Рет қаралды 35 М.
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 262 #shorts
00:20