public void Execute(object parameter) { FileFinderDisplayItemViewModel Item = parameter as FileFinderDisplayItemViewModel; if (Item == null) { return; } string FilePath = Item.Path; if (!System.IO.File.Exists(FilePath) && !System.IO.Directory.Exists(FilePath)) { return; } Process.Start(FilePath); }
public void Execute(object parameter) { FileFinderDisplayItemViewModel Item = parameter as FileFinderDisplayItemViewModel; if (Item == null) { return; } string DirectoryPath = Item.Path; if (!System.IO.Directory.Exists(Item.Path)) { DirectoryPath = System.IO.Path.GetDirectoryName(Item.Path); } if (!System.IO.Directory.Exists(DirectoryPath)) { return; } Process.Start(DirectoryPath); }