private void AddDownloadExecute() { if (!string.IsNullOrEmpty(SaveFilePath)) { InputUrlView inputUrlView = new InputUrlView(); Window popup = new DialogWindow(inputUrlView, ResApplication.AddUrl); popup.ShowDialog(); if (popup.DialogResult.Value == true) { var dialogWindowViewModel = popup.DataContext as DialogWindowViewModel; var currentPage = dialogWindowViewModel.CurrentPage as InputUrlView; var vm = currentPage.DataContext as InputUrlViewModel; OVDownload download = new OVDownload { Url = vm.Url, Title = vm.Title, SavePath = SaveFilePath }; ListDownload.Add(download); Task.Run(() => { download.Start(vm.IsMp3); }); } } else { DialogMessageView dialogMessageView = new DialogMessageView(ResApplication.NeedSaveRepository); Window popup = new DialogWindow(dialogMessageView, ResApplication.Error); popup.ShowDialog(); } }
void MOnline_DownloadCompleted(MySong Output) { Status_Download.Text = "Download '" + Output.Name + "' complete !"; ListDownload.Add(Output); }