the function playMedia is called again and again inside the timer_tick function for 60 sec...how do i call it just once so that my song plays continuously for that interval without looping.... here song is my media element..
protected override void OnNavigatedTo(NavigationEventArgs e)
{
timer.Start();
timer.Tick +=timer_tick;
}
int flagmusic=0;
public void timer_tick(object sender, object args)
{
//if some condition which is true for 60 secs
playMedia();
//else
song.stop();
}
private void playMedia()
{
try
{
Uri pathUri = new Uri("ms-appx:///Assets/breath.mp3");
song.Source = pathUri;
song.Play();
}
catch { }
}