From 5253f8c776333f1fd2be7dcb10a788d31304d54a Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 27 Jul 2014 06:06:50 +0400 Subject: [PATCH] (DirectoryPosition): remember item as string. --- MainWindow.xaml.cs | 2 +- ViewModel.cs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 3e0af96c..65f0edb6 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -515,7 +515,7 @@ namespace GARbro.GUI vm.SetPosition (pos); ViewModel = vm; if (null != pos.Item) - lv_SelectItem (pos.Item.Name); + lv_SelectItem (pos.Item); return true; } catch (Exception X) diff --git a/ViewModel.cs b/ViewModel.cs index 314c2736..7ca8eb5f 100644 --- a/ViewModel.cs +++ b/ViewModel.cs @@ -281,12 +281,12 @@ namespace GARbro.GUI { public string Path { get; set; } public string ArchivePath { get; set; } - public EntryViewModel Item { get; set; } + public string Item { get; set; } public DirectoryPosition (DirectoryViewModel vm, EntryViewModel item) { Path = vm.Path; - Item = item; + Item = item.Name; if (vm.IsArchive) ArchivePath = (vm as ArchiveViewModel).SubDir; else @@ -297,8 +297,7 @@ namespace GARbro.GUI { Path = System.IO.Path.GetDirectoryName (filename); ArchivePath = ""; - var entry = FormatCatalog.Instance.CreateEntry (filename); - Item = new EntryViewModel (entry, 0); + Item = System.IO.Path.GetFileName (filename); } } }