Hello. I have Simple application.
<Window x:Class="WpfControlReview.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="120" Width="277" ResizeMode="NoResize">
<Grid>
<Button HorizontalAlignment="Stretch" Name="button1" VerticalAlignment="Stretch" HorizontalContentAlignment="Center" Click="button1_Click">
<StackPanel HorizontalAlignment="Stretch" Name="stackPanel1" VerticalAlignment="Stretch" Orientation="Vertical">
<Label IsHitTestVisible="False" Content="Select your options and press to commit" Name="label1" HorizontalContentAlignment="Center" FontSize="12" />
<StackPanel Name="stackPanel2" Orientation="Horizontal">
<Expander Header="Color" x:Name="expander1"/>
<Expander Header="Make" x:Name="expander2"/>
<Expander Header="Payment" x:Name="expander3"/>
</StackPanel>
</StackPanel>
</Button>
</Grid>
</Window>
private void button1_Click(object sender, System.Windows.RoutedEventArgs e)
{
Application.Current.Shutdown();
}
When I click button application closes. That is what I want. But when I click on one of the expanders application also closes. How to avoid that? I don't want application to close when user clicks on one of three arrows.