I have a scroll problem for my WPF application.
Here is the deal. My user interface is as follows:

The role of my application is to act as a central hub for many applications and run them. An administrator can start a dump recorded by another user. So I have a ListViewshowing application list that scrolls if necessary. I defined a GroupStyleto show expanders and emulate a Windows Explorer view. Everything works fine, I just have a problem: when scrolling with the mouse wheel, the component in transparent blue (“Launch Mode”) seems to capture focus and stop scrolling. This is especially important if my mouse is out of this control, scrolling is fine. But whenever the mouse enters this control, I can no longer scroll. I tried changing the property Focusableand setting it toFalsewherever he could, but nothing has changed. I guess this is finally not a focus issue. Does anyone have an idea on how to avoid scrolling that needs to be caught by an element?
Here are some (simplified, removed some useless properties to make them as clear as possible) XAML for the contents of the expander:
<StackPanel Orientation="Vertical" VerticalAlignment="Top" >
<ToggleButton>
</ToggleButton>
<my:UcReleaseChooser >
</my:UcReleaseChooser>
</StackPanel>
And the code for UcReleaseChooser:
<StackPanel HorizontalAlignment="Stretch"
Focusable="False" ScrollViewer.CanContentScroll="False">
<ListBox ItemsSource="{Binding ListChosenReleases}" BorderBrush="LightGray" Background="AliceBlue"
HorizontalAlignment="Stretch" Focusable="False" ScrollViewer.CanContentScroll="False">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"
Focusable="False" ScrollViewer.CanContentScroll="False"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<DockPanel LastChildFill="True" HorizontalAlignment="Stretch"
Focusable="False" ScrollViewer.CanContentScroll="False">
<TextBlock DockPanel.Dock="Top"
HorizontalAlignment="Left" Text="{Binding Key}"
FontStyle="Italic"/>
<ListBox DockPanel.Dock="Bottom"
HorizontalAlignment="Right" ItemsSource="{Binding Value}"
BorderBrush="{x:Null}" Background="AliceBlue"
Focusable="False" ScrollViewer.CanContentScroll="False">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Focusable="False"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<-- Blah blah about style -->
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<RadioButton Content="{Binding Key}" Margin="3"
IsChecked="{Binding Path=IsSelected, Mode=TwoWay,
RelativeSource={RelativeSource FindAncestor,
AncestorType={x:Type ListBoxItem}}}"
Focusable="False" ScrollViewer.CanContentScroll="False"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DockPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
As you can see, it UcReleaseChoosercontains a list of RadioButtonlists. I tried to install Focusableit CanContentScrollon Falsewherever it was convenient, but the control continues to prevent the main user interface from scrolling ...
I think I should change another property ... Any idea?
Thank!
source
share