Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6964543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:56:17+00:00 2026-05-27T15:56:17+00:00

I´m facing this problem: I have a Button that works like a WrapPanel using

  • 0

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:

<ControlTemplate x:Key="WrapLikeTemplate">            
            <WrapPanel Name="wpBody" Orientation="Horizontal" Margin="0,5,0,0">                   
                <Button Content="{Binding XPath=./BUTTONS/Button[1]/Text}" Click="b1_Click" Height="55" Name="b1" Width="157" Margin="65,10" />
                <Button Content="{Binding XPath=./BUTTONS/Button[2]/Text}" Click="b2_Click" Height="55" Name="b2" Width="157" Margin="65,10" />
                <Button Content="{Binding XPath=./BUTTONS/Button[3]/Text}" Click="b3_Click" Height="55" Name="b3" Width="157" Margin="65,10" />
                <Button Content="{Binding XPath=./BUTTONS/Button[4]/Text}" Click="b4_Click" Height="55" Name="b4" Width="157" Margin="65,10" />
                <Button Content="{Binding XPath=./BUTTONS/Button[5]/Text}" Click="b5_Click" Height="55" Name="b5" Width="157" Margin="65,10" />
                <Button Content="{Binding XPath=./BUTTONS/Button[6]/Text}" Click="b6_Click" Height="55" Name="b6" Width="157" Margin="65,10" />
                <Button Content="{Binding XPath=./BUTTONS/Button[7]/Text}" Click="b7_Click" Height="55" Name="b7" Width="157" Margin="65,10" />
                <Button Content="{Binding XPath=./BUTTONS/Button[8]/Text}" Click="b8_Click" Height="55" Name="b8" Width="157" Margin="65,10" />
                <Button Content="{Binding XPath=./BUTTONS/Button[9]/Text}" Click="b9_Click" Height="55" Name="b9" Width="157" Margin="65,10" />
                <Button Content="{Binding XPath=./BUTTONS/Button[10]/Text}" Click="b10_Click" Height="55" Name="b10" Width="157" Margin="65,10" />                    
            </WrapPanel>            
    </ControlTemplate>

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!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:56:18+00:00Added an answer on May 27, 2026 at 3:56 pm

    in the event handler:

    private void b1_Click(object sender, RoutedEventArgs e)
    {
        e.Handled = true;
    }
    

    should work.

    EDIT: I tried it. It works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing a situation that I have problem understanding... I am writing a
I have a view hierarchy that looks something like this: UIView (A) UIView >
The problem i am facing with floated div is i have written this piece
I have done localization of my app. The problem that I'm facing is that,
I am facing problem during event handling. The problem is like this: My GUI
I'm facing this problem again and again, but can't find any solution (except mine,
I was facing this unique problem of generating a bit-mask based on the input
I'm facing a problem with IE6. I took the toggle function from this website
I am facing a problem while creating a static cursor in DB2. This is
A horizontal compass looks something like this if you are facing due East (90

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.