I am trying to create a custom CardView control. I have a stack of cards (Grid with Image and TextBlock) and on swiping left or right I am moving the card left or right and on threshold I am removing the card. I am acheiving this using the Grid manipulation events. This behaviour works fine. But the issue is when I place this usercontrol (CardView) inside a scrollable page. For example, I have a page with a ScrollViewer and lot of contents with it and the last item of the page being the CardView. The page smoothly scrolls till the end. But when I try to scroll the page up, it takes the manipulation events of the Grid (within the CardView) because of which I am not able to scroll up.
The manipulation delta of the Grid is below: And I have written the code to remove the card in OnManipulationCompleted.
<Grid ManipulationCompleted="OnManipulationCompleted"
ManipulationDelta="OnManipulationDelta"
ManipulationStarted="Border_ManipulationStarted"
ManipulationMode="All">
<Grid.RenderTransform>
<CompositeTransform x:Name="transform" TranslateX="0" />
</Grid.RenderTransform>
// Image and TextBlock goes here
</Grid>
private void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
transform.TranslateX += e.Delta.Translation.X;
}
Any workaround?
Thank you