Click event of a button that contains more buttons, fires events wrong?

Up vote 0 down vote favorite share g+ share fb share tw.

I´m facing this problem: I have a Button that works like a WrapPanel using the property "Template" Template="{StaticResource WrapLikeTemplate}" Where "WrapLikeTemplate is as follows: So, if I click on a Button, it fires its click event first, and then the click event of its parent; I mean the button that contains it (the one with the WrapPanel Template). What I need is that when a button is pressed, to execute the click event of it, and just this, NOT the click event of its parent. Thanks in advance!

C# .net wpf button click link|improve this question asked Dec 21 '11 at 13:03MorgoZ31.

In the event handler: private void b1_Click(object sender, RoutedEventArgs e) { e. Handled = true; } should work. EDIT: I tried it.

It works.

Thanks! It works ;) – MorgoZ Dec 21 '11 at 14:02.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions