mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-21 22:03:11 -07:00
fix aot mode
This commit is contained in:
parent
4ddedef97c
commit
3a48c8857b
1 changed files with 8 additions and 6 deletions
|
@ -206,12 +206,14 @@ namespace CalculatorApp.ManagedViewModels
|
||||||
var DefaultSize = new Size(320, 394);
|
var DefaultSize = new Size(320, 394);
|
||||||
const string LaunchedSettingsKey = "calculatorAlwaysOnTopLaunched";
|
const string LaunchedSettingsKey = "calculatorAlwaysOnTopLaunched";
|
||||||
var settings = ApplicationData.Current.LocalSettings;
|
var settings = ApplicationData.Current.LocalSettings;
|
||||||
bool success;
|
|
||||||
if (ApplicationView.GetForCurrentView().ViewMode == ApplicationViewMode.CompactOverlay)
|
if (ApplicationView.GetForCurrentView().ViewMode == ApplicationViewMode.CompactOverlay)
|
||||||
{
|
{
|
||||||
settings.Values[WidthLocalSettingsKey] = width;
|
settings.Values[WidthLocalSettingsKey] = width;
|
||||||
settings.Values[HeightLocalSettingsKey] = height;
|
settings.Values[HeightLocalSettingsKey] = height;
|
||||||
success = await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.Default);
|
bool success = await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.Default);
|
||||||
|
_calcVm.HistoryVM.AreHistoryShortcutsEnabled = success;
|
||||||
|
_calcVm.IsAlwaysOnTop = !success;
|
||||||
|
IsAlwaysOnTop = !success;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -233,11 +235,11 @@ namespace CalculatorApp.ManagedViewModels
|
||||||
compactOptions.CustomSize = DefaultSize;
|
compactOptions.CustomSize = DefaultSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
success = await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.CompactOverlay, compactOptions);
|
bool success = await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.CompactOverlay, compactOptions);
|
||||||
|
_calcVm.HistoryVM.AreHistoryShortcutsEnabled = !success;
|
||||||
|
_calcVm.IsAlwaysOnTop = success;
|
||||||
|
IsAlwaysOnTop = success;
|
||||||
}
|
}
|
||||||
_calcVm.HistoryVM.AreHistoryShortcutsEnabled = success;
|
|
||||||
_calcVm.IsAlwaysOnTop = !success;
|
|
||||||
IsAlwaysOnTop = !success;
|
|
||||||
SetDisplayNormalAlwaysOnTopOption();
|
SetDisplayNormalAlwaysOnTopOption();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue