The question is simple and can be summed up by:
How can I get this while loop to exit?
System.Windows.Media.MediaPlayer player = new System.Windows.Media.MediaPlayer();
WeakReference test = new WeakReference(player);
player.Close();
player = null;
while (test.IsAlive && test.Target != null)
{
System.GC.Collect();
}
I have searched the documentation and have found no way to dispose of this object, the while loop never exits.