title: C# .Net WPF Custom User Control zIndex issue with similar user control
body: <p>User control details: </p>
  
  <p>Have created drop down list control (Like as combo box), clicking on down arrow button, it displays a list below the text box</p>
  
  <p>I have set zIndex property of my User control</p>
  
  <p>Issue:</p>
  
  <p>Case 1: When there is another user control (other than my custom user control), and if drop down list is displayed, other user control hides behind my user control. This is perfectly Ok</p>
  
  <p>Case 2: There are 2 Custom User controls, if list is displayed from first user control, second user control appears on the list. This is where i am facing issue</p>
  
  <p>XAML of my control is as below</p>
  
  <pre><code>    &lt;UserControlx:Class="UserControls.AutoCompleteComboBox"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Panel.ZIndex="1110" LostFocus="UserControl_LostFocus" Height="Auto"&gt;
  
          &lt;Canvas Name="MainCanvas"&gt;
              &lt;Grid&gt;
                  &lt;Grid.RowDefinitions&gt;
                      &lt;RowDefinition&gt;&lt;/RowDefinition&gt;
                      &lt;RowDefinition&gt;&lt;/RowDefinition&gt;
                  &lt;/Grid.RowDefinitions&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition Width="Auto" MinWidth="150"&gt;&lt;/ColumnDefinition&gt;
                      &lt;ColumnDefinition Width="20"&gt;&lt;/ColumnDefinition&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
                  &lt;TextBox Name="autoTextBox" Height="20" MinWidth="150" Width="Auto" MinHeight="20" Style="{DynamicResource AutoCompleteBox}" BorderThickness="2"
                       Margin="0,0,0,0" TextWrapping="NoWrap"  Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Top"/&gt;
                  &lt;Button Content="6" FontFamily="Marlett" Grid.Row="0" Grid.Column="1" FontSize="15" Margin="0,0,0,0" Height="20" Width="20" HorizontalAlignment="Right" VerticalAlignment="Top" Background="{StaticResource BackgroudBlueBrush}"  Click="Button_Click" Padding="0" Cursor="Hand"&gt;&lt;/Button&gt;
                  &lt;StackPanel Grid.Row="1" Grid.ColumnSpan="2" &gt;
                      &lt;ListBox Name="suggestionListBox" SelectionChanged="suggestionListBox_SelectionChanged" MouseDown="suggestionListBox_MouseDown"
                       Background="LightYellow" SnapsToDevicePixels="True"
                       Visibility="Collapsed" 
                       MinWidth="150" IsHitTestVisible="True" MinHeight="70" Height="70"
                       VerticalAlignment="Top" LostFocus="suggestionListBox_LostFocus"/&gt;
                  &lt;/StackPanel&gt;
              &lt;/Grid&gt;
          &lt;/Canvas&gt;
  &lt;/UserControl&gt;
  </code></pre>