Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

I am working on an XML driven UI. My application parses an XML and create UI as per the parsed information.

Now in that UI, we can have various controls like TextBlock, TextBox, ComboBox, DatePicker, DockPanel, TabControl, ListView etc and in any combination. Please see below XAML. Whatever control we want to add in the UI, is added into the ParentStackPanel (you can say that it's parent of all the controls).

HTML
<UserControl>
    <StackPanel Name="ParentStackPanel">
    ...
    </StackPanel>
</UserControl>



The size of ParentStackPanel will keep on increasing with more and more controls in it. UI comes with a scrollbar so that user can scroll the UI to go up and down.

The Problem:
While scrolling if the mouse cursor comes at some ListView, scrolling stops here. Please see below XAML. You can see that the UI have one ListView inside it. Scrolling works smoothly but it suddenly stops when mouse cursor reaches over that ListView.

HTML
<UserControl>
    <StackPanel Name="ParentStackPanel">
    <TextBlock />
    <TextBox />
    <ComboBox />
    <TabControl />
    <ListView /> Scrolling stops here
    <DatePicker />
    <TextBlock />
    <TextBox />
    </StackPanel>
</UserControl>


Please let me know, why it happens and how can I resolve this problem.

Thanks in advance.
Aseem Sharma
Posted
Comments
S@53K^S 10-Apr-12 16:49pm    
I guess the ListView is taking over the Mouse Scrolling at that point.try Disabling that feature for that particular element it will work.

1 solution

ListView does not propagate mouse events to its parent. There are several different ways how you could handle it. One method described here[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900