mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 22:23:29 -07:00
Avoid crashing
This commit is contained in:
parent
9c36d93329
commit
0a901685c8
3 changed files with 4 additions and 4 deletions
|
@ -159,7 +159,7 @@ namespace CalculatorApp
|
||||||
// For very first launch, set the size of the calc as size of the default standard mode
|
// For very first launch, set the size of the calc as size of the default standard mode
|
||||||
if (!localSettings.Values.ContainsKey("VeryFirstLaunch"))
|
if (!localSettings.Values.ContainsKey("VeryFirstLaunch"))
|
||||||
{
|
{
|
||||||
localSettings.Values.Add("VeryFirstLaunch", false);
|
localSettings.Values["VeryFirstLaunch"] = false;
|
||||||
appView.SetPreferredMinSize(minWindowSize);
|
appView.SetPreferredMinSize(minWindowSize);
|
||||||
appView.TryResizeView(minWindowSize);
|
appView.TryResizeView(minWindowSize);
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,7 +129,7 @@ namespace CalculatorApp
|
||||||
{
|
{
|
||||||
string propertyName = isMatchAppTheme ? "IsMatchAppTheme" : "IsAlwaysLightTheme";
|
string propertyName = isMatchAppTheme ? "IsMatchAppTheme" : "IsAlwaysLightTheme";
|
||||||
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
|
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
|
||||||
localSettings.Values.Add("IsGraphThemeMatchApp", isMatchAppTheme);
|
localSettings.Values["IsGraphThemeMatchApp"] = isMatchAppTheme;
|
||||||
GraphThemeSettingChanged?.Invoke(this, isMatchAppTheme);
|
GraphThemeSettingChanged?.Invoke(this, isMatchAppTheme);
|
||||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogGraphSettingsChanged(GraphSettingsType.Theme, propertyName);
|
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogGraphSettingsChanged(GraphSettingsType.Theme, propertyName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -463,8 +463,8 @@ namespace CalculatorApp
|
||||||
if (m_model.IsAlwaysOnTop)
|
if (m_model.IsAlwaysOnTop)
|
||||||
{
|
{
|
||||||
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
|
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
|
||||||
localSettings.Values.Add(ApplicationViewModel.WidthLocalSettings, ActualWidth);
|
localSettings.Values[ApplicationViewModel.WidthLocalSettings] = ActualWidth;
|
||||||
localSettings.Values.Add(ApplicationViewModel.HeightLocalSettings, ActualHeight);
|
localSettings.Values[ApplicationViewModel.HeightLocalSettings] = ActualHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue