Skip to content

Commit bbc1665

Browse files
authored
Improved settings code (#919)
1 parent 5da1351 commit bbc1665

17 files changed

+73
-65
lines changed

Files/DataModels/TerminalModel.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Newtonsoft.Json;
2-
using System.ComponentModel.DataAnnotations;
32

43
namespace Files.DataModels
54
{

Files/Filesystem/ListedItem.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Files.Enums;
22
using System;
33
using System.ComponentModel;
4-
using System.IO;
54
using Windows.Storage;
65
using Windows.UI.Xaml.Media.Imaging;
76

@@ -158,7 +157,7 @@ public static string GetFriendlyDate(DateTimeOffset d)
158157
else
159158
{
160159
return string.Format(ResourceController.GetTranslation("SecondsAgo"), elapsed.Seconds);
161-
}
160+
}
162161
}
163162
}
164163
}

Files/Helpers/PackageHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ public static async Task<bool> IsAppInstalledAsync(string packageName)
4444
}
4545
}
4646
}
47-
}
47+
}

Files/UserControls/LayoutModes/GenericFileBrowser.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@
362362
x:Load="{x:Bind local:App.InteractionViewModel.IsContentLoadingIndicatorVisible, Mode=OneWay}"
363363
Background="Transparent"
364364
VerticalAlignment="Top"
365-
IsIndeterminate="True"/>
365+
IsIndeterminate="True" />
366366
<TextBlock
367367
x:Name="EmptyText"
368368
x:Uid="EmptyFolder"

Files/UserControls/LayoutModes/GridViewBrowser.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@
548548
x:Load="{x:Bind local:App.InteractionViewModel.IsContentLoadingIndicatorVisible, Mode=OneWay}"
549549
Background="Transparent"
550550
VerticalAlignment="Top"
551-
IsIndeterminate="True"/>
551+
IsIndeterminate="True" />
552552
<TextBlock
553553
x:Name="EmptyText"
554554
x:Uid="EmptyFolder"

Files/View Models/InteractionViewModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ namespace Files.Controls
88
public class InteractionViewModel : ViewModelBase
99
{
1010
private bool _IsContentLoadingIndicatorVisible = false;
11+
1112
public bool IsContentLoadingIndicatorVisible
1213
{
1314
get => _IsContentLoadingIndicatorVisible;

Files/Views/InstanceTabsView.xaml

Lines changed: 42 additions & 44 deletions
Large diffs are not rendered by default.

Files/Views/SettingsPages/Appearance.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
Grid.Column="2"
111111
Width="40"
112112
HorizontalAlignment="Right"
113-
IsOn="{x:Bind local:App.AppSettings.AcrylicEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource BoolNegationConverter}}"
113+
IsOn="{x:Bind AppSettings.AcrylicEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource BoolNegationConverter}}"
114114
OffContent=""
115115
OnContent="" />
116116
</Grid>

Files/Views/SettingsPages/Appearance.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Files.Enums;
22
using Files.Helpers;
3+
using Files.View_Models;
34
using System;
45
using System.Collections.Generic;
56
using Windows.UI.Xaml;
@@ -9,6 +10,8 @@ namespace Files.SettingsPages
910
{
1011
public sealed partial class Appearance : Page
1112
{
13+
public SettingsViewModel AppSettings => App.AppSettings;
14+
1215
public Appearance()
1316
{
1417
InitializeComponent();

Files/Views/SettingsPages/Experimental.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
Grid.Column="2"
5959
Width="40"
6060
HorizontalAlignment="Right"
61-
IsOn="{x:Bind local2:App.AppSettings.DoubleTapToRenameFiles, Mode=TwoWay}"
61+
IsOn="{Binding AppSettings.DoubleTapToRenameFiles, Mode=TwoWay}"
6262
OffContent=""
6363
OnContent="" />
6464
</Grid>
@@ -87,7 +87,7 @@
8787
Grid.Column="2"
8888
Width="40"
8989
HorizontalAlignment="Right"
90-
IsOn="{x:Bind local2:App.AppSettings.PinRecycleBinToSideBar, Mode=TwoWay}"
90+
IsOn="{x:Bind AppSettings.PinRecycleBinToSideBar, Mode=TwoWay}"
9191
OffContent=""
9292
OnContent="" />
9393
</Grid>

0 commit comments

Comments
 (0)