/// <summary> /// Delete file or move it to recycle bin, navigate to next pic /// and display information /// </summary> /// <param name="Recyclebin"></param> internal static void DeleteFile(bool Recyclebin) { if (!TryDeleteFile(Pics[FolderIndex], Recyclebin)) { ShowTooltipMessage(Application.Current.Resources["AnErrorOccuredWhenDeleting"] + Environment.NewLine + Pics[FolderIndex]); return; } // Sync with gallery if (UC.GetPicGallery != null) { UC.GetPicGallery.Container.Children.RemoveAt(Pics.IndexOf(Pics[FolderIndex])); } // Sync with preloader Preloader.Remove(Pics[FolderIndex]); Pics.Remove(Pics[FolderIndex]); if (Pics.Count <= 0) { Unload(); return; } Pic(false); ShowTooltipMessage(Recyclebin ? Application.Current.Resources["SentFileToRecycleBin"] : Application.Current.Resources["Deleted"]); }