File tree Expand file tree Collapse file tree
Nickvision.Application.Shared/Controllers
Nickvision.Application.WinUI/Views Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public class PreferencesViewController : IDisposable
1515{
1616 private readonly IConfigurationService _configurationService ;
1717 private readonly ITranslationService _translationService ;
18- private readonly SqliteTransaction _transaction ;
18+ private readonly SqliteTransaction ? _transaction ;
1919
2020 public IReadOnlyList < SelectionItem < string > > AvailableTranslationLanguages { get ; }
2121 public IReadOnlyList < SelectionItem < Theme > > Themes { get ; }
@@ -72,14 +72,21 @@ public void Dispose()
7272 GC . SuppressFinalize ( this ) ;
7373 }
7474
75- public Task SaveConfigurationAsync ( ) => _transaction . CommitAsync ( ) ;
76-
75+ public async Task SaveConfigurationAsync ( )
76+ {
77+ if ( _transaction is not null )
78+ {
79+ await _transaction . CommitAsync ( ) ;
80+ await _transaction . DisposeAsync ( ) ;
81+ _transaction = null ;
82+ }
83+ }
7784 private void Dispose ( bool disposing )
7885 {
7986 if ( ! disposing )
8087 {
8188 return ;
8289 }
83- _transaction . Dispose ( ) ;
90+ _transaction ? . Dispose ( ) ;
8491 }
8592}
Original file line number Diff line number Diff line change 1010 xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
1111 mc : Ignorable =" d" Loaded =" Page_Loaded" Unloaded =" Page_Unloaded" >
1212
13- <NavigationView x : Name =" NavigationView" IsPaneToggleButtonVisible =" False" IsBackButtonVisible =" Collapsed" IsSettingsVisible =" False"
14- PaneDisplayMode =" Left" SelectionChanged =" NavigationView_SelectionChanged" >
13+ <NavigationView x : Name =" NavigationView" HorizontalAlignment =" Stretch" VerticalAlignment =" Stretch"
14+ IsPaneToggleButtonVisible =" False" IsBackButtonVisible =" Collapsed" IsSettingsVisible =" False"
15+ PaneDisplayMode =" Left" OpenPaneLength =" 240" SelectionChanged =" NavigationView_SelectionChanged" >
1516 <NavigationView .Resources>
1617 <SolidColorBrush x : Key =" NavigationViewContentBackground" Color =" Transparent" />
1718 <SolidColorBrush x : Key =" NavigationViewContentGridBorderBrush" Color =" Transparent" />
You can’t perform that action at this time.
0 commit comments