mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-20 13:23:13 -07:00
Resize on the first launch (#2165)
This commit is contained in:
parent
80fafa0946
commit
10df81d11c
1 changed files with 6 additions and 6 deletions
|
@ -96,14 +96,17 @@ namespace CalculatorApp
|
|||
var minWindowWidth = Convert.ToSingle(Resources["AppMinWindowWidth"]);
|
||||
var minWindowHeight = Convert.ToSingle(Resources["AppMinWindowHeight"]);
|
||||
var minWindowSize = SizeHelper.FromDimensions(minWindowWidth, minWindowHeight);
|
||||
var appView = ApplicationView.GetForCurrentView();
|
||||
var localSettings = ApplicationData.Current.LocalSettings;
|
||||
|
||||
// SetPreferredMinSize should always be called before Window.Activate
|
||||
appView.SetPreferredMinSize(minWindowSize);
|
||||
|
||||
ApplicationView appView = ApplicationView.GetForCurrentView();
|
||||
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
|
||||
// For very first launch, set the size of the calc as size of the default standard mode
|
||||
if (!localSettings.Values.ContainsKey("VeryFirstLaunch"))
|
||||
{
|
||||
localSettings.Values["VeryFirstLaunch"] = false;
|
||||
appView.TryResizeView(minWindowSize);
|
||||
appView.TryResizeView(minWindowSize); // the requested size must not be less than the min size.
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -136,9 +139,6 @@ namespace CalculatorApp
|
|||
throw new SystemException("6d430286-eb5d-4f8d-95d2-3d1059552968");
|
||||
}
|
||||
|
||||
// SetPreferredMinSize should always be called before Window.Activate
|
||||
appView.SetPreferredMinSize(minWindowSize);
|
||||
|
||||
// Place the frame in the current Window
|
||||
Window.Current.Content = rootFrame;
|
||||
ThemeHelper.InitializeAppTheme();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue