amarmesic / windows-phone-navigation-drawer

Navigation Drawer Layout for Windows Phone 8.1
61 stars 21 forks source link

Can't open/close drawer when content panel is a ListView #3

Open leojplin opened 9 years ago

leojplin commented 9 years ago

This is implemented but it doesn't work for me. Calling open drawer in code works. But manipulation on the main fragment doesn't. What could be the cause?

Edit: I think I know the cause. I have listviews on both fragments of the drawerlayout control. I think the manipulation events are hijacked by the listviews, and the underlying grids don't get notified of the events. Is there a fix to this?

XHotSniperX commented 9 years ago

Yeah, would be nice if this could work even when there are components on the fragments.

amarmesic commented 9 years ago

@XHotSniperX @leoxy520 Have you tried setting the background property on the list fragment or increase ZIndex value? If that fails, please let me know.

XHotSniperX commented 9 years ago

@amarmesic I want to describe the problem so you can reproduce it: When you have a ListView or let's say ScrollViewer on the left fragment (the side menu) as in your demo application AND the list is longer than the screen so you can scroll through THAN the slide effect will no longer work. It works only when the ListView or ScrollView is short enough so there is no scrolling possible.

Make your ListFragment longer so you can scroll than you'll see this issue. And btw this happens on the right fragment too :)

leojplin commented 9 years ago

@XHotSniperX I wonder why is it the case only when the listview is bigger than the screen. I originally thought the problem was because the manipulation event doesn't get sent to the fragment grid because the listview inside of it "hijacks" the events.

XHotSniperX commented 9 years ago

@amarmesic And yes, background or ZIndex don't fix it.

leojplin commented 9 years ago

http://blogs.msdn.com/b/wsdevsol/archive/2013/02/16/where-did-all-my-gestures-go.aspx

Seems like the hack that can solve the problem. But why isn't there a better or built-in way by the framework that handles such situation?

When I was doing some android dev, I have the same requirement to handle horizontal and vertical manipulation on a control that reacts differently for each kind of manipulation. I did not find a solution for my problem and I thought it was a limitation of the andriod framework. But I am encountering the same problem on XAML, which I am not expecting at all. Hopefully, there is a solution from the XAML team soon.

johnmurphy01 commented 9 years ago

I believe I'm having the same(or similar) issue. I have a DrawerLayout control inside my View. The drawerlayout ListFragment grid surrounds a user control which contains several components, including a ListView. I can successfully drag the drawer closed if I touch-drag the right-most side of the drawer. However, if I try to drag close the drawer when my finger is on top of the list view, it does not work.