diff --git a/src/Calculator.Shared/Views/Calculator.xaml.cs b/src/Calculator.Shared/Views/Calculator.xaml.cs index 67812635..c6f1e954 100644 --- a/src/Calculator.Shared/Views/Calculator.xaml.cs +++ b/src/Calculator.Shared/Views/Calculator.xaml.cs @@ -301,6 +301,11 @@ namespace CalculatorApp void OnIsStandardPropertyChanged(bool oldValue, bool newValue) { + if (newValue) + { + EnsureStandard(); + } + UpdateViewState(); UpdatePanelViewState(); } @@ -430,6 +435,11 @@ namespace CalculatorApp } } + void EnsureStandard() + { + OpsPanel.EnsureStandardOps(); + } + void EnsureScientific() { OpsPanel.EnsureScientificOps(); diff --git a/src/Calculator.Shared/Views/OperatorsPanel.xaml b/src/Calculator.Shared/Views/OperatorsPanel.xaml index eb36d32b..c91e7380 100644 --- a/src/Calculator.Shared/Views/OperatorsPanel.xaml +++ b/src/Calculator.Shared/Views/OperatorsPanel.xaml @@ -11,7 +11,7 @@ diff --git a/src/Calculator.Shared/Views/OperatorsPanel.xaml.cs b/src/Calculator.Shared/Views/OperatorsPanel.xaml.cs index dd995187..ecec5a2e 100644 --- a/src/Calculator.Shared/Views/OperatorsPanel.xaml.cs +++ b/src/Calculator.Shared/Views/OperatorsPanel.xaml.cs @@ -88,6 +88,14 @@ namespace CalculatorApp } } + internal void EnsureStandardOps() + { + if (StandardOperators == null) + { + this.FindName("StandardOperators"); + } + } + internal void EnsureScientificOps() { if (ScientificOperators == null)