diff --git a/src/Calculator/App.xaml.cs b/src/Calculator/App.xaml.cs index d1345fcc..73046d99 100644 --- a/src/Calculator/App.xaml.cs +++ b/src/Calculator/App.xaml.cs @@ -159,7 +159,7 @@ namespace CalculatorApp // For very first launch, set the size of the calc as size of the default standard mode if (!localSettings.Values.ContainsKey("VeryFirstLaunch")) { - localSettings.Values.Add("VeryFirstLaunch", false); + localSettings.Values["VeryFirstLaunch"] = false; appView.SetPreferredMinSize(minWindowSize); appView.TryResizeView(minWindowSize); } diff --git a/src/Calculator/Controls/MathRichEditBox.cs b/src/Calculator/Controls/MathRichEditBox.cs index 23966eb3..ce642790 100644 --- a/src/Calculator/Controls/MathRichEditBox.cs +++ b/src/Calculator/Controls/MathRichEditBox.cs @@ -137,7 +137,7 @@ namespace CalculatorApp // If the rich edit has content already, then the mathzone will already be created due to mathonly mode being set and the selection will exist inside the // math zone. To handle this, we will force a math zone to be created in teh case of the text being empty and then replacing the text inside of the math // zone with the newly inserted text. - if (GetMathTextProperty() == null) + if (string.IsNullOrEmpty(GetMathTextProperty())) { SetMathTextProperty("x"); TextDocument.Selection.StartPosition = 0; diff --git a/src/Calculator/Views/GraphingCalculator/GraphingSettings.xaml.cs b/src/Calculator/Views/GraphingCalculator/GraphingSettings.xaml.cs index 654ba213..e056a471 100644 --- a/src/Calculator/Views/GraphingCalculator/GraphingSettings.xaml.cs +++ b/src/Calculator/Views/GraphingCalculator/GraphingSettings.xaml.cs @@ -129,7 +129,7 @@ namespace CalculatorApp { string propertyName = isMatchAppTheme ? "IsMatchAppTheme" : "IsAlwaysLightTheme"; ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings; - localSettings.Values.Add("IsGraphThemeMatchApp", isMatchAppTheme); + localSettings.Values["IsGraphThemeMatchApp"] = isMatchAppTheme; GraphThemeSettingChanged?.Invoke(this, isMatchAppTheme); CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogGraphSettingsChanged(GraphSettingsType.Theme, propertyName); } diff --git a/src/Calculator/Views/MainPage.xaml.cs b/src/Calculator/Views/MainPage.xaml.cs index 9893b7c4..9f5522f9 100644 --- a/src/Calculator/Views/MainPage.xaml.cs +++ b/src/Calculator/Views/MainPage.xaml.cs @@ -463,8 +463,8 @@ namespace CalculatorApp if (m_model.IsAlwaysOnTop) { ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings; - localSettings.Values.Add(ApplicationViewModel.WidthLocalSettings, ActualWidth); - localSettings.Values.Add(ApplicationViewModel.HeightLocalSettings, ActualHeight); + localSettings.Values[ApplicationViewModel.WidthLocalSettings] = ActualWidth; + localSettings.Values[ApplicationViewModel.HeightLocalSettings] = ActualHeight; } }