GreenEyedAndy
GreenEyedAndy

Reputation: 1525

Click through ListBox to underlying Control

Hi I want to click through my listBox (click on empty space) and want the click on the underlying border control. I'm really sure that I have done this in the past using {x:Null} as the Background for a control. But this time it doesn't work.

Any hint why?

 <Grid>
     <Border x:Name="BrushBorder" Background="{Binding ActualBrush}" Margin="7,0" Height="10"
             VerticalAlignment="Top" Cursor="Pen">
         <dxmvvm:Interaction.Behaviors>
             <dxmvvm:EventToCommand EventName="MouseDown" Command="{Binding NewGradientStopCommand}" PassEventArgsToCommand="True" />
         </dxmvvm:Interaction.Behaviors>
     </Border>
     <ListBox x:Name="GradientStopListBox" ItemsSource="{Binding GradientStops}" SelectedItem="{Binding ActualGradientStop}"
              HorizontalContentAlignment="Stretch"
              VerticalContentAlignment="Stretch" 
              Background="{x:Null}" BorderBrush="{x:Null}">

Upvotes: 0

Views: 289

Answers (1)

GreenEyedAndy
GreenEyedAndy

Reputation: 1525

I found the answer. The ListBox includes a ScrollViewer and this is causing the mouse click the stay in the ListBox regradless of the BackgroundBrush.

See this question for further information: Transparent WPF ListBox with selectable items

Upvotes: 1

Related Questions