Question about manipulation : How to horizontally swipe on control to do something ?


  •         <Grid Grid.Row="1" x:Name="ContentRoot" Margin="19,9.5,19,0">
                <ListView x:Name="cc" ManipulationMode="TranslateX" ManipulationDelta="cc_ManipulationDelta"  />
    I want to swipe horizontally to change the ItemsSource of the ListView?, but it only change the first time, then which part of the code need to be changed?
            private void cc_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
                this.pageTitle.Text = e.Delta.Translation.X.ToString();
                if (e.Delta.Translation.X > 0)
                    this.cc.ItemsSource = list1;
                else if (e.Delta.Translation.X < 0)
                    this.cc.ItemsSource = list3;
    Monday, January 12, 2015 4:25 AM


  • Your code works fine for me.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, January 12, 2015 7:16 PM