@@ -35,14 +35,13 @@ public partial class SettingsWindow
3535 public SettingsWindow ( MainWindow mainWindow , LogController logController )
3636 {
3737 _logController = logController ;
38+ _mainWindow = mainWindow ;
3839 _logController . AddLog ( new ApplicationLog ( "Initializing SettingsWindow" ) ) ;
3940
4041 InitializeComponent ( ) ;
4142 ChangeVisualStyle ( ) ;
4243 LoadProperties ( ) ;
4344
44- _mainWindow = mainWindow ;
45-
4645 _logController . AddLog ( new ApplicationLog ( "Done initializing SettingsWindow" ) ) ;
4746 }
4847
@@ -153,6 +152,8 @@ private void LoadProperties()
153152 CboStyle . Text = Properties . Settings . Default . VisualStyle ;
154153 CpMetroBrush . Color = Properties . Settings . Default . MetroColor ;
155154 IntBorderThickness . Value = Properties . Settings . Default . BorderThickness ;
155+ SldOpacity . Value = Properties . Settings . Default . WindowOpacity * 100 ;
156+ SldWindowResize . Value = Properties . Settings . Default . WindowResizeBorder ;
156157 }
157158 catch ( Exception ex )
158159 {
@@ -268,16 +269,17 @@ private void SaveProperties()
268269
269270 //Theme
270271 Properties . Settings . Default . VisualStyle = CboStyle . Text ;
271-
272272 Properties . Settings . Default . MetroColor = CpMetroBrush . Color ;
273273 if ( IntBorderThickness . Value != null ) Properties . Settings . Default . BorderThickness = ( int ) IntBorderThickness . Value ;
274+ Properties . Settings . Default . WindowOpacity = SldOpacity . Value / 100 ;
275+ Properties . Settings . Default . WindowResizeBorder = SldWindowResize . Value ;
274276
275277 Properties . Settings . Default . Save ( ) ;
276278
277- LoadProperties ( ) ;
278279 _mainWindow . ChangeVisualStyle ( ) ;
279280 _mainWindow . LoadProperties ( ) ;
280281 ChangeVisualStyle ( ) ;
282+ LoadProperties ( ) ;
281283
282284 _logController . AddLog ( new ApplicationLog ( "Properties have been saved" ) ) ;
283285
@@ -452,5 +454,25 @@ private void LsvExclusions_OnDrop(object sender, DragEventArgs e)
452454 }
453455 }
454456 }
457+
458+ /// <summary>
459+ /// Method that is called when the opacity should change dynamically
460+ /// </summary>
461+ /// <param name="sender">The object that called this method</param>
462+ /// <param name="e">The RoutedPropertyChangedEventArgs</param>
463+ private void SldOpacity_OnValueChanged ( object sender , RoutedPropertyChangedEventArgs < double > e )
464+ {
465+ Opacity = SldOpacity . Value / 100 ;
466+ }
467+
468+ /// <summary>
469+ /// Method that is called when the ResizeBorderThickness should change dynamically
470+ /// </summary>
471+ /// <param name="sender">The object that called this method</param>
472+ /// <param name="e">The RoutedPropertyChangedEventArgs</param>
473+ private void SldWindowResize_OnValueChanged ( object sender , RoutedPropertyChangedEventArgs < double > e )
474+ {
475+ ResizeBorderThickness = new Thickness ( SldWindowResize . Value ) ;
476+ }
455477 }
456478}
0 commit comments