private void DownloadTabComplete(TabEntity tab, string filePath) { CurrentTabEntity = tab; // TabEntity CurrentPopularTabEntity = SearchPopularTabs.FirstOrDefault(t => t.SearchId == tab.SearchId); Deployment.Current.Dispatcher.BeginInvoke( () => { if (!Database.IsGroupExists(CurrentTabEntity.Group)) { //Raise Band downloaded Hub.RaiseBandCreated(); } CurrentTab = new Tab { Name = tab.Name, Group = Database.GetOrCreateGroupByName(tab.Group), TabType = Database.GetTabTypeByName(tab.Type), Rating = tab.Rating, Path = filePath, }; Database.InsertTab(CurrentTab); //run album images search var tabAlbumSearch = _mediaSearcherFactory.Create(); tabAlbumSearch.MediaSearchCompleted += tabAlbumSearch_MediaSearchCompleted; tabAlbumSearch.RunMediaSearch(CurrentTab.Group.Name, CurrentTab.Name); Hub.RaiseTabsDownloaded(); //run group images search var groupImagesSearch = _mediaSearcherFactory.Create(); groupImagesSearch.MediaSearchCompleted += groupImagesSearch_MediaSearchCompleted; groupImagesSearch.RunMediaSearch(tab.Group, string.Empty); CurrentTabEntity.IsDownloaded = true; CurrentTabEntity.Id = CurrentTab.Id; IsDownloading = false; Dialog.Show(AppResources.Search_TabDownloadedText, String.Format(AppResources.Search_TabDownloadedTitle, CurrentTabEntity.Name, CurrentTabEntity.Group), new DialogActionContainer { OnTapAction = (o, e) => DoGoToTabView(CurrentTab.Id) }); DownloadTab.RaiseCanExecuteChanged(); }); }
public void FocusDownload() { DownloadTab.Focus(); UpdateLayout(); }