Skip to content

Commit c9b815b

Browse files
committed
Reduce duplicate code
1 parent 7578ba0 commit c9b815b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/Files.App/ViewModels/Settings/AdvancedViewModel.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@ public sealed partial class AdvancedViewModel : ObservableObject
1919
{
2020
private IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetRequiredService<IUserSettingsService>();
2121
private ICommonDialogService CommonDialogService { get; } = Ioc.Default.GetRequiredService<ICommonDialogService>();
22-
private ICommandManager Commands { get; } = Ioc.Default.GetRequiredService<ICommandManager>();
22+
public ICommandManager Commands { get; } = Ioc.Default.GetRequiredService<ICommandManager>();
2323

2424
private readonly IFileTagsSettingsService fileTagsSettingsService = Ioc.Default.GetRequiredService<IFileTagsSettingsService>();
2525

2626
public ICommand SetAsDefaultExplorerCommand { get; }
2727
public ICommand SetAsOpenFileDialogCommand { get; }
2828
public ICommand ExportSettingsCommand { get; }
2929
public ICommand ImportSettingsCommand { get; }
30-
public ICommand OpenSettingsJsonCommand { get; }
3130
public AsyncRelayCommand OpenFilesOnWindowsStartupCommand { get; }
3231

3332

@@ -40,7 +39,6 @@ public AdvancedViewModel()
4039
SetAsOpenFileDialogCommand = new AsyncRelayCommand(SetAsOpenFileDialogAsync);
4140
ExportSettingsCommand = new AsyncRelayCommand(ExportSettingsAsync);
4241
ImportSettingsCommand = new AsyncRelayCommand(ImportSettingsAsync);
43-
OpenSettingsJsonCommand = Commands.OpenSettingsFile;
4442
OpenFilesOnWindowsStartupCommand = new AsyncRelayCommand(OpenFilesOnWindowsStartupAsync);
4543

4644
_ = DetectOpenFilesAtStartupAsync();

src/Files.App/Views/Settings/AdvancedPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
<!-- Edit Settings File -->
6565
<wctcontrols:SettingsCard
66-
Command="{x:Bind ViewModel.OpenSettingsJsonCommand}"
66+
Command="{x:Bind ViewModel.Commands.OpenSettingsFile, Mode=OneWay}"
6767
Header="{helpers:ResourceString Name=EditSettingsFile}"
6868
IsClickEnabled="True">
6969
<wctcontrols:SettingsCard.HeaderIcon>

0 commit comments

Comments
 (0)