|
19 | 19 | using Windows.Foundation; |
20 | 20 | using Windows.Foundation.Collections; |
21 | 21 | using Windows.UI.Notifications; |
| 22 | +using Windows.UI.ViewManagement; |
22 | 23 | using Windows.UI.Xaml; |
23 | 24 | using Windows.UI.Xaml.Controls; |
24 | 25 | using Windows.UI.Xaml.Controls.Primitives; |
@@ -47,12 +48,7 @@ sealed partial class App : Application |
47 | 48 | public App() |
48 | 49 | { |
49 | 50 | this.InitializeComponent(); |
50 | | - bool isDisableScale = AppTool.GetBoolSetting(Settings.DisableXboxScale); |
51 | | - if (SystemInformation.DeviceFamily == "Windows.Xbox" && isDisableScale) |
52 | | - { |
53 | | - Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().SetDesiredBoundsMode(Windows.UI.ViewManagement.ApplicationViewBoundsMode.UseCoreWindow); |
54 | | - Windows.UI.ViewManagement.ApplicationViewScaling.TrySetDisableLayoutScaling(true); |
55 | | - } |
| 51 | + |
56 | 52 | CustomXamlResourceLoader.Current = new CustomResourceLoader(); |
57 | 53 | this.Suspending += OnSuspending; |
58 | 54 | UnhandledException += OnUnhandleException; |
@@ -147,9 +143,9 @@ private void OnLaunchedOrActivated(IActivatedEventArgs e) |
147 | 143 | if (rootFrame.Content == null) |
148 | 144 | { |
149 | 145 | if (_isTabletMode) |
150 | | - rootFrame.Navigate(typeof(TabletMainPage),null); |
| 146 | + rootFrame.Navigate(typeof(TabletMainPage), null); |
151 | 147 | else |
152 | | - rootFrame.Navigate(typeof(DesktopMainPage),null); |
| 148 | + rootFrame.Navigate(typeof(DesktopMainPage), null); |
153 | 149 | } |
154 | 150 | } |
155 | 151 | else if (e is ToastNotificationActivatedEventArgs toastActivationArgs) |
@@ -183,6 +179,14 @@ private void OnLaunchedOrActivated(IActivatedEventArgs e) |
183 | 179 | } |
184 | 180 | Window.Current.Activate(); |
185 | 181 | UIHelper.SetTitleBarColor(); |
| 182 | + bool isDisableScale = AppTool.GetBoolSetting(Settings.DisableXboxScale); |
| 183 | + if (SystemInformation.DeviceFamily == "Windows.Xbox") |
| 184 | + { |
| 185 | + var view = ApplicationView.GetForCurrentView(); |
| 186 | + view.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow); |
| 187 | + if (isDisableScale) |
| 188 | + ApplicationViewScaling.TrySetDisableLayoutScaling(true); |
| 189 | + } |
186 | 190 | } |
187 | 191 | catch (Exception ex) |
188 | 192 | { |
|
0 commit comments