工作区保存参数增加浏览路径
This commit is contained in:
@@ -39,11 +39,6 @@ namespace SpineViewer.ViewModels.MainWindow
|
||||
|
||||
private readonly MainWindowViewModel _vmMain;
|
||||
|
||||
/// <summary>
|
||||
/// 当前目录路径
|
||||
/// </summary>
|
||||
private string? _currentDirectory;
|
||||
|
||||
/// <summary>
|
||||
/// 当前目录下文件项缓存
|
||||
/// </summary>
|
||||
@@ -54,12 +49,26 @@ namespace SpineViewer.ViewModels.MainWindow
|
||||
_vmMain = vmMain;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当前目录路径
|
||||
/// </summary>
|
||||
public string? CurrentDirectory
|
||||
{
|
||||
get => string.IsNullOrWhiteSpace(_currentDirectory) ? null : _currentDirectory;
|
||||
set
|
||||
{
|
||||
if (!SetProperty(ref _currentDirectory, value)) return;
|
||||
RefreshItems();
|
||||
}
|
||||
}
|
||||
private string? _currentDirectory;
|
||||
|
||||
/// <summary>
|
||||
/// 筛选字符串
|
||||
/// </summary>
|
||||
public string? FilterString
|
||||
{
|
||||
get => _filterString;
|
||||
get => string.IsNullOrWhiteSpace(_filterString) ? null : _filterString;
|
||||
set
|
||||
{
|
||||
if (!SetProperty(ref _filterString, value)) return;
|
||||
@@ -95,10 +104,7 @@ namespace SpineViewer.ViewModels.MainWindow
|
||||
public RelayCommand Cmd_ChangeCurrentDirectory => _cmd_ChangeCurrentDirectory ??= new(() =>
|
||||
{
|
||||
if (DialogService.ShowOpenFolderDialog(out var selectedPath))
|
||||
{
|
||||
_currentDirectory = selectedPath;
|
||||
RefreshItems();
|
||||
}
|
||||
CurrentDirectory = selectedPath;
|
||||
});
|
||||
private RelayCommand? _cmd_ChangeCurrentDirectory;
|
||||
|
||||
|
||||
@@ -118,12 +118,14 @@ namespace SpineViewer.ViewModels.MainWindow
|
||||
{
|
||||
return new()
|
||||
{
|
||||
ExploringDirectory = _explorerListViewModel.CurrentDirectory,
|
||||
RendererConfig = _sfmlRendererViewModel.WorkspaceConfig,
|
||||
LoadedSpineObjects = _spineObjectListViewModel.LoadedSpineObjects
|
||||
};
|
||||
}
|
||||
set
|
||||
{
|
||||
_explorerListViewModel.CurrentDirectory = value.ExploringDirectory;
|
||||
_sfmlRendererViewModel.WorkspaceConfig = value.RendererConfig;
|
||||
_spineObjectListViewModel.LoadedSpineObjects = value.LoadedSpineObjects;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user