0

Im using the toolkit GestureService.GestureListener, the implementation is going very well.

The main page contains a LongListSelector, and on the top (not visible to the user) I have my sliding menu that I slide using the GestureService.

when I try to scroll in the LongListSelector the menu on the top comes down, which is not good.

if im scrolling on the list don't slide the menu, other than that, slide the menu !

how to handle such an event.

thanks

Edit

 <Grid x:Name="LayoutRoot">
    <toolkit:GestureService.GestureListener>
        <toolkit:GestureListener DragDelta="GestureListener_DragDelta" 
                                 DragCompleted="GestureListener_DragCompleted" />
    </toolkit:GestureService.GestureListener>

    <phone:Panorama Foreground="Black">

        <phone:PanoramaItem>
                <Phone:LongListSelector x:Name="MyList"
                            ItemTemplate="{StaticResource MyListTemplate}"/>
        </phone:PanoramaItem>

        <phone:PanoramaItem>

        </phone:PanoramaItem>
   </phone:Panorama >      
 </Grid>

And this is my C# Code

    private void CloseSettings()
    {
        var trans = _feContainer.GetVerticalOffset().Transform;
        trans.Animate(trans.Y, 0, TranslateTransform.YProperty, 500, 0, new CubicEase //trans.Y, 0, TranslateTransform.YProperty, 120, 0, new CubicEase
        {
            EasingMode = EasingMode.EaseOut
        });

        _isSettingsOpen = false;
    }

    private void OpenSettings()
    {
        var trans = _feContainer.GetVerticalOffset().Transform;
        trans.Animate(trans.Y, 400, TranslateTransform.YProperty, 200, 0, new CubicEase
        {
            EasingMode = EasingMode.EaseInOut
        });

        _isSettingsOpen = true;
    }

    private void ResetLayoutRoot()
    {
        if (!_isSettingsOpen)
            _feContainer.SetVerticalOffset(0.0);
        else
            _feContainer.SetVerticalOffset(120.0);
    }

    private void GestureListener_DragDelta(object sender, DragDeltaGestureEventArgs e)
    {
        if (e.Direction == System.Windows.Controls.Orientation.Vertical && e.VerticalChange > 0 && !_isSettingsOpen)
        {
            double offset = _feContainer.GetVerticalOffset().Value + e.VerticalChange;
            if (offset > _dragDistanceToOpen)
                this.OpenSettings();
            else
                _feContainer.SetVerticalOffset(offset);
        }

        if (e.Direction == System.Windows.Controls.Orientation.Vertical && e.VerticalChange < 0 && _isSettingsOpen)
        {
            double offsetContainer = _feContainer.GetVerticalOffset().Value + e.VerticalChange;
            if (offsetContainer < _dragDistanceToClose)
                this.CloseSettings();
            else
                _feContainer.SetVerticalOffset(offsetContainer);
        }
    }
    private void GestureListener_DragCompleted(object sender, DragCompletedGestureEventArgs e)
    {
        if (e.Direction == System.Windows.Controls.Orientation.Vertical && e.VerticalChange > 0 && !_isSettingsOpen)
        {
            if (e.VerticalChange < _dragDistanceToOpen)
                this.ResetLayoutRoot();
            else
                this.OpenSettings();
        }

        if (e.Direction == System.Windows.Controls.Orientation.Vertical && e.HorizontalChange < 0               && _isSettingsOpen)
        {
            if (e.VerticalChange > _dragDistanceNegative)
                this.ResetLayoutRoot();
            else
                this.CloseSettings();
        }
    }

Variables declared in the class, its working really good, but as i said before, when I scroll in my longListSelector, the menu slides down, i dont want that !

Ibraheem Al-Saady
  • 854
  • 3
  • 14
  • 30
  • Probably gonna need more code to see where your hotzones are at. The answer could be as easy as setting the `IsHitTestVisible` to false when certain conditions are met. – Chubosaurus Software Sep 14 '14 at 10:20

1 Answers1

0

This only happens when the parent is not receiving the invokation call . What I suggest you to do is to add IsHitTestVisible =False to your Menu and see whether it works or not

Apoorv
  • 2,023
  • 1
  • 19
  • 42