private void ExecuteMediaCommandsPlay(object sender, ExecutedRoutedEventArgs e) { e.Handled = true; var s = new Song((UrlInfo) e.Parameter); Play(s); }
async void Play(Song s) { Current = s; var mp3 = await Current.FetchMp3(); if (string.IsNullOrEmpty(mp3)) { Prompt = "Expand url faield"; return; } Prompt = "Fetching Music..."; await Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle, (Action)(() => { Prompt = null; _player.Source = new Uri(mp3); _player.Play(); })); }