title: Prevent collapse/expand wpf expander by added to header buttons
body: <p>I have the following problem: I have to add couple of additional buttons to the Expander header(in order to change presentation scheme of expander content - graph or table).
  But the problem is that when I press these buttons the Expander is collapsing or expanding (and I want only the content changing). It kind of bubble event as I remember from the web development. I found the following solution for CancelBubble:
          e.Handled = true;
  but it doesn't help</p>
  
  <pre><code>&lt;Expander x:Name="xpdNumberDevices"&gt;
      &lt;Expander.Header &gt;
          &lt;Border Background="#E5E5E5"&gt;
              &lt;StackPanel Width="605" Height="40" Orientation="Horizontal" HorizontalAlignment="Center"&gt;
                  &lt;Label Foreground="Black" Content="Number of Devices" 
                          HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,0,0" FontSize="14" /&gt;
                  &lt;Image x:Name="imgGraphNumberDevices" Height="24" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="380,0,0,0"
                          MouseLeftButtonUp="btnNumDeviceGraph_Click"&gt;
                      &lt;Image.Style&gt;
                          &lt;Style TargetType="{x:Type Image}"&gt;
                              &lt;Setter Property="Source" Value="/Pictures/graph_button.png"/&gt;
                                  &lt;Style.Triggers&gt;
                                      &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                                          &lt;Setter Property="Source" Value="/Pictures/graph_button_over.png"/&gt;
                                      &lt;/Trigger&gt;
                                 &lt;/Style.Triggers&gt;
                           &lt;/Style&gt;
                       &lt;/Image.Style&gt;    
                  &lt;/Image&gt;
                  &lt;Image Height="24" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,0,0"
                 MouseLeftButtonUp="btnNumDeviceTable_Click"&gt;
                      &lt;Image.Style&gt;
                          &lt;Style TargetType="{x:Type Image}"&gt;
                              &lt;Setter Property="Source" Value="/Pictures/table_button.png"/&gt;
                              &lt;Style.Triggers&gt;
                                  &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                                      &lt;Setter Property="Source" Value="/Pictures/table_button_over.png"/&gt;
                                  &lt;/Trigger&gt;
                               &lt;/Style.Triggers&gt;
                           &lt;/Style&gt;
                       &lt;/Image.Style&gt;    
                   &lt;/Image&gt;
               &lt;/StackPanel&gt;
            &lt;/Border&gt;
        &lt;/Expander.Header&gt;
        &lt;my:Chart Name="crtDeviceNumberChart" Title="Number of Devices" VerticalAlignment="Top" Margin="20,5,0,0" Height="280" Width="600" BorderBrush="#FFE5E5E5"&gt;
            &lt;my:BarSeries Title="Devices" DependentValuePath="Key" IndependentValuePath="Value" ItemsSource="{Binding}" IsSelectionEnabled="True" /&gt;
        &lt;/my:Chart&gt;                            
    &lt;/Expander&gt;
  </code></pre>