I have a ScrollViewer with an ItemPresenter inside.
The ItemsPresenter contains a few dropdowns, and when I open one of those, I'd like to disable the parent ScrollViewer's scroll and only re-enable it only when the dropbox is closed.
By saying "disable" I mean prevent scrolling at all (even with the mouse wheel).
I've tried to set the VerticalScrollBarVisibility to Disabled like this:
<ScrollViewer HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Disabled">
<ItemsPresenter />
</ScrollViewer>
but that doesn't work either.
It just hides the scrollbar, but the mouse wheel still works.
So, is there a way to completely disable the ScrollViewer's scroll?
Here is the full code that I have:
<ListView.Template>
<ControlTemplate>
<ScrollViewer HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="{Binding IsScrollEnabled, Converter={StaticResource BoolToVisibilityConverter}}">
<ItemsPresenter />
</ScrollViewer>
</ControlTemplate>
</ListView.Template>
P.S. There are lots of some similar questions like this and this, but none of them is the one I wanted.