In my Main Page I am binding to a MainViewModel that exposes a ObserveableCollection FactItems. FactItems is populated from a mocked up Dataservice class.

In my XAML I have a CollectionView with an ItemTemplate containing a Label and the MediaElement. When I run the app I see the labels and the MediaElement controls in a List as expected. I can also play/stop the Videos.

In the current behavior, if I am playing a video I can click on another video to start playing and both videos will now be playing with audio. What I want ideally is that if one video is playing and I start another video to play, I want the previous video to stop playing. Also, I would like be able to stop any video playing if I scroll video off the screen. I am not sure if that is possible. My testing so far is using the Android emulator. I am at a loss how to reference the individual MediaElement controls from the ViewModel or the Code Behind. I tried using the Events UnFocused/Focused & MediaStateChanged, but that doesn't give me a reference to a specific item.

I have uploaded my project to github for more context.

0

There are 0 best solutions below