• Upgrade your Internet Experience
  • Sign in
  • Microsoft.com
  • United States (English)
    Brasil (Português)Česká republika (Čeština)Deutschland (Deutsch)España (Español)France (Français)Italia (Italiano)Россия (Русский)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語)香港特别行政區 (中文)
 
 
.NET Framework Developer Center
 
 
Home
 
 
Library
 
 
Learn
 
 
Downloads
 
 
Support
 
 
Community
 
 
Forums
 
 
 
.NET Framework Developer Center > .NET Development Forums > Windows Presentation Foundation (WPF) > Bubbling and Tunneling Events
Ask a questionAsk a question
Search Forums:
  • Search Windows Presentation Foundation (WPF) Forum Search Windows Presentation Foundation (WPF) Forum
  • Search All .NET Development Forums Search All .NET Development Forums
  • Search All MSDN Forums Search All MSDN Forums
 

AnswerBubbling and Tunneling Events

  • Wednesday, June 21, 2006 7:53 PMTomer Shamam Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    Hi,

    I'm running the following XAML:

    <Window x:Class="Controls.Window1"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Title="Controls" Height="300" Width="300"

    >

    <WrapPanel>

    <Button x:Name="button"

    PreviewMouseLeftButtonDown="PreviewA"

    MouseLeftButtonDown="A">

    <Grid

    PreviewMouseLeftButtonDown="PreviewB"

    MouseLeftButtonDown="B">

    <WrapPanel>

    <Ellipse Fill="Blue" Margin="5" Width="25" Height="25" Stroke="Black" HorizontalAlignment="Center" VerticalAlignment="Center"

    PreviewMouseLeftButtonDown="PreviewC"

    MouseLeftButtonDown="C"

    />

    <TextBlock Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" Text="Click Me!"

    PreviewMouseLeftButtonDown="PreviewD"

    MouseLeftButtonDown="D"

    />

    </WrapPanel>

    </Grid>

    </Button>

    </WrapPanel>

    </Window>

    Each event handler writes  its name using Debug.WriteLine().

    The problem is that the Bubble event does not implemented by the Button. How's that?

    The output is:

    PreviewA

    PreviewB

    PreviewC

    C

    B

    Where is 'A' ???

    Is it possible that Button already implements MouseLeftButtonDown to create the "Click" event instead? I think that it is a BUG!

    Tomer

    • ReplyReply
    • QuoteQuote
     

Answers

  • Wednesday, June 21, 2006 8:14 PMviliescuModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Vote As Helpful
    0
    It's not a bug, it is by design.
    Check this thread - the explanation from the documentation:
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=426800&SiteID=1
    • ReplyReply
    • QuoteQuote
     

All Replies

    Need Help with Forums? (FAQ)
     
    © 2009 Microsoft Corporation. All rights reserved.
    Terms of Use
    |
    Trademarks
    |
    Privacy Statement