Browse Source

Fixed being able to open a non existing file

CPKreuz 4 years ago
parent
commit
aacc713a92
1 changed files with 3 additions and 1 deletions
  1. 3 1
      PixiEditor/Views/Dialogs/HelloTherePopup.xaml.cs

+ 3 - 1
PixiEditor/Views/Dialogs/HelloTherePopup.xaml.cs

@@ -49,7 +49,7 @@ namespace PixiEditor.Views.Dialogs
             OpenFileCommand = new RelayCommand(OpenFile);
             OpenNewFileCommand = new RelayCommand(OpenNewFile);
             OpenRecentCommand = new RelayCommand(OpenRecent);
-            OpenInExplorerCommand = new RelayCommand(OpenInExplorer);
+            OpenInExplorerCommand = new RelayCommand(OpenInExplorer, CanOpenInExplorer);
 
             RecentlyOpenedEmpty = RecentlyOpened.Count == 0;
             RecentlyOpened.CollectionChanged += RecentlyOpened_CollectionChanged;
@@ -112,5 +112,7 @@ namespace PixiEditor.Views.Dialogs
 
             Process.Start("explorer.exe", $"/select,\"{path}\"");
         }
+
+        private bool CanOpenInExplorer(object parameter) => File.Exists((string)parameter);
     }
 }