I'm struggling with a kind of a bug I guess.
The App crashes when I keep swiping only with the finger BUT it's not crashing if I use some other method (even for just a single time) to switch to another Item (mouse wheel down, or the arrows which appear after the mouse pointer was moved - even if I tap the arrows with my finger) and continue to swipe with my finger.
What happens while the crash occures?:
I've observed, that the SelectedIndex (bound Twoway to my VM) of my FlipView starts to increase without any user interaction until the SelectedIndex is higher than my Items count -> OutOfRange -> Crash.
Information about my Machine and project:
My Solution was originally created under VS2015, my System is Win 10 Pro x64 Build 14393.
I'm using a FlipView with a modified ItemsPanelTemplate:
<STackPanel, orientation = horizontal, AreScrollSnapPointsRegular='True'/>
My Items for the FlipView are dynamically generated.
My Nuget Packages are: - CommonServiceLocator (Microsoft) 1.3.0
MetroLog (Matt Baxter-Reynolds, Oren Novotny) 1.0.1
Microsoft.NETCore.UniversalWindowsPlatform (Microsoft) 6.0.2
Mirosoft.Xaml.Behaviors.Uwp.Managed (Microsoft) 2.0.0
MvvmLight (Laurent Bugnion /GalaSoft) 5.3.0
Newtonsoft.Json (James Newton-King) 10.0.3
sqlite-net-pcl (Frank A. Krueger) 1.3.3
Template10 (Windows Developers) 1.1.12
I know, Windows is not up to date (see my build nr.) but our IT cannot install updates according to compatibility issues with other software we're using.
My thoughts to solve this problem:
I thought of simulating a [mouse wheel down]-Event but could not find any example or hint how to acheive this in UWP. But I figured out how to simulate a mouse pointer movement, so the arrows appear. But now I don't know how to simulate mouse clicks on one of the arrows, without calculating position and counting pixels.
May be someone of you had a similar problem and could provide some information for me and others with the same issue.
So my questions are:
- Does anyone know why this behavior occurs?
- Is there a solution for that?
if not:
- How can I simulate a [Mouse Wheel Down]-Event programmatically?
- Is there a way to simulate a Click-Event on one of thoose arrows programmatically?
- Is there another workaround which may help me with my issue?
Any useful information or help are very wellcome.
BTW: At the moment I'm not able to provide example code, but if it's absolutely neccessary, I'll of cause try to reconstruct this behavior in a fresh sln.
Thank you in advance. Alex