@@ -184,6 +184,7 @@ internal void LoadProperties()
184184 MniDisableInactive . IsChecked = Properties . Settings . Default . DisableOnInactive ;
185185 MniOnTop . IsChecked = Properties . Settings . Default . Topmost ;
186186 MniWindowDraggable . IsChecked = Properties . Settings . Default . WindowDragging ;
187+ MniRamStatistics . IsChecked = Properties . Settings . Default . WindowRamStatistics ;
187188 MniRamGauge . IsChecked = Properties . Settings . Default . DisplayGauge ;
188189 MniRamMonitor . IsChecked = Properties . Settings . Default . RamMonitor ;
189190
@@ -208,17 +209,18 @@ internal void LoadProperties()
208209 _ramController . EnableMonitor ( ) ;
209210 }
210211
211- RamGaugeVisibility ( ) ;
212-
213212 TbiIcon . Visibility = ! Properties . Settings . Default . NotifyIcon ? Visibility . Hidden : Visibility . Visible ;
214- WindowDraggable ( ) ;
215213 }
216214 catch ( Exception ex )
217215 {
218216 _logController . AddLog ( new ApplicationLog ( ex . Message ) ) ;
219217 MessageBox . Show ( ex . Message , "MemPlus" , MessageBoxButton . OK , MessageBoxImage . Error ) ;
220218 }
221219
220+ RamGaugeVisibility ( ) ;
221+ RamStatisticsVisibility ( ) ;
222+ WindowDraggable ( ) ;
223+
222224 _logController . AddLog ( new ApplicationLog ( "Done loading MainWindow properties" ) ) ;
223225 }
224226
@@ -316,6 +318,22 @@ private void RamGaugeVisibility()
316318 }
317319 }
318320
321+ /// <summary>
322+ /// Check whether the RAM statistics should be displayed in the MainWindow
323+ /// </summary>
324+ private void RamStatisticsVisibility ( )
325+ {
326+ try
327+ {
328+ GrdRamStatistics . Visibility = Properties . Settings . Default . WindowRamStatistics ? Visibility . Visible : Visibility . Collapsed ;
329+ }
330+ catch ( Exception ex )
331+ {
332+ _logController . AddLog ( new ApplicationLog ( ex . Message ) ) ;
333+ MessageBox . Show ( ex . Message , "MemPlus" , MessageBoxButton . OK , MessageBoxImage . Error ) ;
334+ }
335+ }
336+
319337 /// <summary>
320338 /// Check whether the Window should be draggable or not
321339 /// </summary>
@@ -667,14 +685,33 @@ private void WindowDraggableMenuItem_OnCheckedChanged(object sender, RoutedEvent
667685 {
668686 Properties . Settings . Default . WindowDragging = MniWindowDraggable . IsChecked ;
669687 Properties . Settings . Default . Save ( ) ;
688+ }
689+ catch ( Exception ex )
690+ {
691+ _logController . AddLog ( new ApplicationLog ( ex . Message ) ) ;
692+ MessageBox . Show ( ex . Message , "MemPlus" , MessageBoxButton . OK , MessageBoxImage . Error ) ;
693+ }
694+ WindowDraggable ( ) ;
695+ }
670696
671- WindowDraggable ( ) ;
697+ /// <summary>
698+ /// Method that is called when the RAM statistics visibility should be changed
699+ /// </summary>
700+ /// <param name="sender">The object that called this method</param>
701+ /// <param name="e">The RoutedEventArgs</param>
702+ private void RamStatisticsMenuItem_OnCheckedChanged ( object sender , RoutedEventArgs e )
703+ {
704+ try
705+ {
706+ Properties . Settings . Default . WindowRamStatistics = MniRamStatistics . IsChecked ;
707+ Properties . Settings . Default . Save ( ) ;
672708 }
673709 catch ( Exception ex )
674710 {
675711 _logController . AddLog ( new ApplicationLog ( ex . Message ) ) ;
676712 MessageBox . Show ( ex . Message , "MemPlus" , MessageBoxButton . OK , MessageBoxImage . Error ) ;
677713 }
714+ RamStatisticsVisibility ( ) ;
678715 }
679716
680717 /// <summary>
@@ -688,14 +725,13 @@ private void RamGaugeMenuItem_OnCheckedChanged(object sender, RoutedEventArgs e)
688725 {
689726 Properties . Settings . Default . DisplayGauge = MniRamGauge . IsChecked ;
690727 Properties . Settings . Default . Save ( ) ;
691-
692- RamGaugeVisibility ( ) ;
693728 }
694729 catch ( Exception ex )
695730 {
696731 _logController . AddLog ( new ApplicationLog ( ex . Message ) ) ;
697732 MessageBox . Show ( ex . Message , "MemPlus" , MessageBoxButton . OK , MessageBoxImage . Error ) ;
698733 }
734+ RamGaugeVisibility ( ) ;
699735 }
700736
701737 /// <summary>
0 commit comments