internal void Refresh() { if (task.IsBusy == false) { this.IsAzureAvailable = SharedFunctions.AzureStorageConnectionCheck(); tempMediaElementsViewModel = (from INotifyPropertyChanged inpc in DataContextsContainer.Containers where inpc is MediaElementsViewModel select inpc).ToList().FirstOrDefault() as MediaElementsViewModel; tempMediaElementsViewModel.Refresh(); tempCreatorViewModel = (from INotifyPropertyChanged inpc in DataContextsContainer.Containers where inpc is CreatorViewModel select inpc).ToList().FirstOrDefault() as CreatorViewModel; tempCreatorViewModel.Refresh(); CDsCount = 0; DVDsCount = 0; BooksCount = 0; AvailableCDsCount = 0; AvailableDVDsCount = 0; AvailableBooksCount = 0; CreatorsCount = 0; task.RunWorkerAsync(); } }
private void CreatorMediaElements(object obj) { tempMediaElementsViewModel = (from INotifyPropertyChanged inpc in DataContextsContainer.Containers where inpc is MediaElementsViewModel select inpc).ToList().FirstOrDefault() as MediaElementsViewModel; tempMediaElementsViewModel.CreatorMediaElements.Clear(); foreach (Models.MediaElement mediaElement in ((Models.Creator)obj).MediaElements) { Models.Creator temp = new Models.Creator() { CreatorId = ((Models.Creator)obj).CreatorId, Name = ((Models.Creator)obj).Name, Surname = ((Models.Creator)obj).Surname }; mediaElement.Creator = temp; tempMediaElementsViewModel.CreatorMediaElements.Add(mediaElement); } tempMainWindowViewModel = (from INotifyPropertyChanged inpc in DataContextsContainer.Containers where inpc is MainWindowViewModel select inpc).ToList().FirstOrDefault() as MainWindowViewModel; tempMainWindowViewModel.IsShowingCreatorMediaElements = true; tempMainWindowViewModel.IsShowingCreatorMediaElements = false; }