diff --git a/src/Calculator.Shared/App.xaml.cs b/src/Calculator.Shared/App.xaml.cs index dac57e65..bf38c091 100644 --- a/src/Calculator.Shared/App.xaml.cs +++ b/src/Calculator.Shared/App.xaml.cs @@ -106,8 +106,12 @@ namespace CalculatorApp public static string GetAppViewState() { String newViewState; - CoreWindow window = CoreWindow.GetForCurrentThread(); - if ((window.Bounds.Width >= 560) && (window.Bounds.Height >= 356)) +#if NETFX_CORE + CoreWindow window = CoreWindow.GetForCurrentThread(); +#else + var window = Windows.UI.Xaml.Window.Current; +#endif + if ((window.Bounds.Width >= 560) && (window.Bounds.Height >= 356)) { newViewState = ViewState.DockedView; } diff --git a/src/Calculator.Shared/ViewModels/StandardCalculatorViewModel.cs b/src/Calculator.Shared/ViewModels/StandardCalculatorViewModel.cs index 92b64cc2..5b772e5e 100644 --- a/src/Calculator.Shared/ViewModels/StandardCalculatorViewModel.cs +++ b/src/Calculator.Shared/ViewModels/StandardCalculatorViewModel.cs @@ -573,7 +573,7 @@ namespace CalculatorApp.ViewModel m_decimalSeparator = LocalizationSettings.GetInstance().GetDecimalSeparator(); -#if !__WASM__ +#if !__WASM__ && !__IOS__ if (CoreWindow.GetForCurrentThread() != null) { // Must have a CoreWindow to access the resource context.