private void ImagePanel_StartSlideshow(object sender, EventArgs e) { IImagePanel imagePanel = (IImagePanel)sender; string imageKey = View.ImagePanels[imagePanel]; SlideshowService.StartSlideshow(imageKey, (o) => imagePanel.SetImage(o.ToBitmapSource()), 0); }
private void MenuPanel_PlayAnimation(object sender, EventArgs e) { IImagePanel imagePanel = View.ImagePanels.SelectedPanel; string imageKey = View.ImagePanels.SelectedPanelKey; SlideshowService.StartSlideshow(imageKey, (o) => imagePanel.SetImage(o.ToBitmapSource()), 0); }
private void ImagePanel_SelectedIconsChanged(object sender, EventArgs e) { IImagePanel imagePanel = (IImagePanel)sender; IImageList image = Repository[View.ImagePanels[imagePanel]]; int[] icons = imagePanel.SelectedIcons; int iconIndex = icons.Length > 0 ? icons[0] : -1; imagePanel.SetImage(image.ElementAtOrDefault(iconIndex)?.ToBitmapSource()); }
private void Repository_ItemAdded(object sender, string e) { IImageList image = Repository[e]; IImagePanel imagePanel = View.ImagePanels.AddPanel(e, Path.GetFileName(e)); imagePanel.SetImage(null); imagePanel.SetIcons(image.ToBitmapSources()); AppController.EventController .Subscribe(imagePanel, nameof(imagePanel.SelectedIconsChanged), ImagePanel_SelectedIconsChanged); }
private void Repository_ItemChanged(object sender, string e) { IImageList image = Repository[e]; IImagePanel imagePanel = View.ImagePanels[e]; int[] icons = imagePanel.SelectedIcons; int iconIndex = icons.Length > 0 ? icons[0] : -1; if (!SlideshowService.IsRunning(e)) { imagePanel.SetImage(image.ElementAtOrDefault(iconIndex)?.ToBitmapSource()); } imagePanel.SetIcons(image.ToBitmapSources()); }