Пример #1
0
 private object ExecuteAddImages(object images)
 {
     // get all needed sources and add the image to the collage
     List<ImageSource> imageSources = new List<ImageSource>();
     foreach (Image image in (List<Image>)images)
     {
         imageSources.Add(image.Source);
         editData.Collage.Images.Add(image);
     }
     // reverse the list because the top images should be loaded at first for a better user experience
     imageSources.Reverse();
     AsyncImageSourcesLoader loader = new AsyncImageSourcesLoader(dataAccess, imageSources);
     loader.LoadAll();
     // set images as selection
     editData.SelectedImages.Clear();
     editData.SelectedImages.AddRange((List<Image>)images);
     return images;
 }
Пример #2
0
        public object UndoClearCollage(object data)
        {
            List<Image> images = (List<Image>)((List<object>)data)[0];
            CollageData collageData = (CollageData)((List<object>)data)[1];

            editData.Collage.Images.AddRange(images);
            editData.Collage.Data = collageData;

            // get all needed sources
            List<ImageSource> imageSources = new List<ImageSource>();
            foreach (Image image in (List<Image>)images)
            {
                imageSources.Add(image.Source);
            }
            // reverse the list because the top images should be loaded at first for a better user experience
            imageSources.Reverse();
            AsyncImageSourcesLoader loader = new AsyncImageSourcesLoader(dataAccess, imageSources);
            loader.LoadAll();

            return null;
        }