I have a WPF 4 and VB.net 2010 project. I am playing videos in a single mediaelement. This is what I need to do:

When the window first opens, I have the first video play just fine. However, it is after this video plays that I run into trouble figuring out how to do the following.

1. I need the video source to change immediately following a single play through of any video, and I need this video (henceforth referred to as an "ambient" video) to loop forever.
2. When a certain event happens, I need to change the video source again, have it play once through, and then go back to looping ambient video in step 1.

Here is the rub, however. Many of the video triggers are inside of If-Then or Select Case statements in code behind, so I'm not exclusively using simple WPF events such as "MouseUp" or "MouseEnter".

Also, all videos must play in the same mediaelement, for performance reasons.

Thank you in advance!

How do I do this?