Example #1
0
        public void InsertPicture(int index, EditablePicture picture)
        {
            var name = picture.Name.Length > 30 ? picture.Name.Substring(0, 30) + "..." : picture.Name;

            Items.Insert(index, new PictureItem {
                Model = picture, IsSelected = true, Header = name
            });
        }
Example #2
0
        public void AddPicture(EditablePicture picture)
        {
            var name = picture.Name.Length > 30 ? picture.Name.Substring(0, 30) + "..." : picture.Name;

            Items.Add(new PictureItem {
                Model = picture, IsSelected = true, Header = name
            });
        }
Example #3
0
 private PictureItem GetPictureItem(EditablePicture model)
 {
     foreach (var item in Items)
     {
         var pictureItem = item as PictureItem;
         if (pictureItem?.Model == model)
         {
             return(pictureItem);
         }
     }
     return(null);
 }
Example #4
0
        public void RemovePicture(EditablePicture picture)
        {
            var pictureItem = GetPictureItem(picture);

            Items.Remove(pictureItem);
        }