From 3794b54ee684f98f3cdf3f9fb3ce92d8341c3267 Mon Sep 17 00:00:00 2001 From: Jorg Tretter Date: Wed, 27 May 2020 15:25:02 -0500 Subject: [PATCH] consider that files can have changed when going next file and last file. --- WPicView/MainWindow.xaml.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/WPicView/MainWindow.xaml.cs b/WPicView/MainWindow.xaml.cs index d4c84b9..86959c0 100644 --- a/WPicView/MainWindow.xaml.cs +++ b/WPicView/MainWindow.xaml.cs @@ -73,6 +73,14 @@ namespace WPicView if (e.Key == System.Windows.Input.Key.Right) { if (fPos < allFiles.Length -1 ) { fPos += 1; + } else + { + // look if more files popped up in the meantime... + allFiles = System.IO.Directory.GetFiles(allDirs[dPos], searchPattern); + if (fPos < allFiles.Length - 1) + { + fPos += 1; + } } } else if (e.Key == System.Windows.Input.Key.Left) { @@ -83,6 +91,7 @@ namespace WPicView if (e.Key == Key.End) { + allFiles = System.IO.Directory.GetFiles(allDirs[dPos], searchPattern); fPos = allFiles.Length - 1; } if (e.Key == Key.Home )