attempted to explain. but few things are not correct. For example, he told that the mousedown on the ellipse not bubbled to the button because the ellipse is not a button, where the reason is incorrect. if that is the case why we can see the outer button clicked message box shown once he removes the message box code and put the title update code in mouseddown even of ellipse. contradicting statements. Even if you put mousedown event handler in the button it won't bubble. you can try it. Looks like the mouse down event is not a routed event. somehow the mousedown is mapped to button click when message box is not shown, but not propagated when the messagebox is shown.
the mouseDown event for the ellipse is not a routed event this is why the click on the ellipse wasn't handlled by the outer button because buttons generats routed events (Click event) but mouseDown event is not a Routed event and you can see that in code behind the two methods don't take the same type of parameters (MouseDowEventArgs and RoutedEventArgs) so the reason why the ellipse doesn't bubble the Container button event is that this was a different kind of events and not because it's an ellepse is not actually a button as you said
Working of two task at time 10:04, when 'I am the green ellipse' message showed the next action 'I am the outer button' did not performed but when 1st action is changed to just title change, 2nd is also performed. Why?
So a routed event can go through the element tree either upwards or downwards, until it reaches the final element. So this means that every one of the (passed through element's) event handler that is subscribed to the event will receive the event information. So if the element tree is like this: Button One Button Two Button Three and if "Button One" was clicked and had a tunneled event, it would go down to and check if Button Two and Button Three are subscribed Am I understanding this correctly? Edit: No, I wasn't understanding it correctly. It doesn't go through every element above or under it in code, it only goes through elements above or under it within the element tree, right? So Button One would only go through right? But then I don't understand the difference between tunneled events and bubbled events because with a tunneled event it would go through and with a bubbled event it would go to right?
Hi friend. Your videos are awesome which will help a lot people who wants to learn WPF. one more thing I am waiting for tutorial on Attached Properties as you have mentioned in this video that you will be uploading soon. Great work! Appreciated.
hi! here I am having one question regarding tunneling event. tunneling event is hierarchy is Up to down as you mentioned in the video.what if I am generating Mouse_Move event of inner button first?
Thank you for the lecture. I think it is not clear. If I do anything on the same way as in the video, I get the same result, but if I change something, I do not understand anymore, what is happening and why. I switched the behavior of green ellipse and container button. So green ellipse pops up a MessageBox, container button should change the title of the window, and the title does not change. What are the restrictions of routed events? :-(
hi,small correction in the video i.e. In the video while explaining tunneling events you are invoking preview event on the Canvas where it should have been on the inner button!
@@dotnetskoool5809 What a bufoon. .Instead of correcting your video which clearly is misleading youre actually just patronizing with GR's response. Ugh!
Thanks for the great video !! I have one doubt (if i am not wrong) , how are you differentiating between mousedown and click events ? When you show messagebox on 'mousedown event' for ellipse OuterButton event is not firing, but when you removed 'messagebox' it is firing. What was happening there ?
You keep yr mouse on ellipse and move yr mouse down... Reason being ellipse dosent have click event, Iam using mouse down event.. And this event is then bubbled up... So it fires after removing too
+DotNetSkoool still confused.. when you remove messagebox from mouse down it triggers both ellipse and label event.. but when you add message box only the ellipse event fires..
Hi! Do you know how to escape from the quotes while typing parameter value numbers? I know it works automatically for alignment="top" and things like that but it doesn't work that way for "not listed" parameter values. Hope my question is clear, I was doing a search but either wrong way put or nobody knows. Thank you.
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-vob1jheMWTE.html is a key point in the video if you are entering the code locally. It's 3:01 into the video.