public void loadProductionListToMovie(int itemID, int year) { productionList.Clear(); List<MRListData> productionListToMovie = db.getProductionListToMovie(itemID, year); productionListToMovie.ForEach(delegate(MRListData actor) { BitmapImage posterBitmap = new BitmapImage(); posterBitmap.BeginInit(); posterBitmap.UriSource = new Uri(PictureHandler.getPersonPortraitPath(actor.dbItemID, PosterSize.LIST)); posterBitmap.EndInit(); MRListBoxItem item = new MRListBoxItem(actor.dbItemID, actor.titleName, actor.yearAge.ToString(), actor.editableCharakter, posterBitmap); productionList.Add(item); }); view.productionListBox.ItemsSource = productionList; }
public void changeItem(int id, MRListBoxItem item) { MRListBoxItem itemToChange; movieListItems.TryGetValue(id, out itemToChange); itemToChange = item; }
public void addItem(int id, MRListBoxItem item) { movieList.Add(item); movieListItems.Add(id, item); }
public void setDetailsView(DetailsView dv) { this.view = dv; view.listBoxMovies.ItemsSource = movieList; Dispatcher disp = Dispatcher.CurrentDispatcher; addToListFunction = (MRListData movie) => disp.BeginInvoke(DispatcherPriority.Background, (new Action(() => { Thread.Sleep(0); BitmapImage posterBitmap = new BitmapImage(); posterBitmap.BeginInit(); posterBitmap.UriSource = new Uri(PictureHandler.getMoviePosterPath(movie.dbItemID, PosterSize.LIST)); posterBitmap.CreateOptions = BitmapCreateOptions.DelayCreation; posterBitmap.CacheOption = BitmapCacheOption.OnDemand; posterBitmap.EndInit(); MRListBoxItem item = new MRListBoxItem(movie.dbItemID, movie.titleName, movie.yearAge.ToString(), movie.editableCharakter, posterBitmap); movieList.Add(item); movieListItems.Add(movie.dbItemID, item); }))); /* var context = SynchronizationContext.Current; addToListFunction = (MRListData movie) => context.Send(delegate(object sender) { BitmapImage posterBitmap = new BitmapImage(); posterBitmap.BeginInit(); posterBitmap.UriSource = new Uri(PictureHandler.getMoviePosterPath(movie.dbItemID, PosterSize.LIST)); posterBitmap.CreateOptions = BitmapCreateOptions.DelayCreation; posterBitmap.CacheOption = BitmapCacheOption.OnDemand; posterBitmap.EndInit(); MRListBoxItem item = new MRListBoxItem(movie.dbItemID, movie.titleName, movie.yearAge.ToString(), movie.editableCharakter, posterBitmap); movieList.Add(item); movieListItems.Add(movie.dbItemID, item); }, null); */ }
public void addItem(int id, MRListBoxItem item) { actorsList.Add(item); listBoxItems.Add(id, item); }
public void setActorsView(ActorsView av) { this.view = av; view.listBoxActor.ItemsSource = actorsList; Dispatcher disp = Dispatcher.CurrentDispatcher; addToListFunction = (MRListData movie) => disp.BeginInvoke(DispatcherPriority.Background, (new Action(() => { Thread.Sleep(0); BitmapImage posterBitmap = new BitmapImage(); posterBitmap.BeginInit(); posterBitmap.UriSource = new Uri(PictureHandler.getPersonPortraitPath(movie.dbItemID, PosterSize.LIST)); posterBitmap.CreateOptions = BitmapCreateOptions.DelayCreation; posterBitmap.CacheOption = BitmapCacheOption.OnDemand; posterBitmap.EndInit(); MRListBoxItem item = new MRListBoxItem(movie.dbItemID, movie.titleName, movie.yearAge.ToString(), movie.editableCharakter, posterBitmap); actorsList.Add(item); listBoxItems.Add(movie.dbItemID, item); }))); }
internal void movieClicked(MRListBoxItem movie) { controller.changeToMovieView(db.getMovieInfo(movie.getId)); }
internal void personClicked(MRListBoxItem person) { controller.changeToPersonView(person.getId); }