Enable support of Scientific calculator

This commit is contained in:
Dr.Rx 2019-05-15 11:41:36 -04:00 committed by Jérôme Laban
commit 1f9abe78a3
2 changed files with 14 additions and 15 deletions

View file

@ -43,7 +43,7 @@ namespace CalculatorApp
} }
public static readonly DependencyProperty IsStandardProperty = public static readonly DependencyProperty IsStandardProperty =
DependencyProperty.Register("IsStandard", typeof(bool), typeof(Calculator), new PropertyMetadata(false)); DependencyProperty.Register("IsStandard", typeof(bool), typeof(Calculator), new PropertyMetadata(false, (snd, args) => ((Calculator)snd).OnIsStandardPropertyChanged((bool)args.OldValue, (bool)args.NewValue)));
@ -54,9 +54,9 @@ namespace CalculatorApp
} }
public static readonly DependencyProperty IsScientificProperty = public static readonly DependencyProperty IsScientificProperty =
DependencyProperty.Register("IsScientific", typeof(bool), typeof(Calculator), new PropertyMetadata(false)); DependencyProperty.Register("IsScientific", typeof(bool), typeof(Calculator), new PropertyMetadata(false, (snd, args) => ((Calculator)snd).OnIsScientificPropertyChanged((bool)args.OldValue, (bool)args.NewValue)));
public bool IsProgrammer public bool IsProgrammer
{ {
get { return (bool)GetValue(IsProgrammerProperty); } get { return (bool)GetValue(IsProgrammerProperty); }
set { SetValue(IsProgrammerProperty, value); } set { SetValue(IsProgrammerProperty, value); }
@ -64,10 +64,10 @@ namespace CalculatorApp
// Using a DependencyProperty as the backing store for IsProgrammer. This enables animation, styling, binding, etc... // Using a DependencyProperty as the backing store for IsProgrammer. This enables animation, styling, binding, etc...
public static readonly DependencyProperty IsProgrammerProperty = public static readonly DependencyProperty IsProgrammerProperty =
DependencyProperty.Register("IsProgrammer", typeof(bool), typeof(Calculator), new PropertyMetadata(false)); DependencyProperty.Register("IsProgrammer", typeof(bool), typeof(Calculator), new PropertyMetadata(false, (snd, args) => ((Calculator)snd).OnIsProgrammerPropertyChanged((bool)args.OldValue, (bool)args.NewValue)));
Windows.UI.Xaml.Controls.ListView m_tokenList; Windows.UI.Xaml.Controls.ListView m_tokenList;
Windows.UI.Xaml.Controls.MenuFlyout m_displayFlyout; Windows.UI.Xaml.Controls.MenuFlyout m_displayFlyout;
bool m_doAnimate; bool m_doAnimate;
bool m_resultAnimate; bool m_resultAnimate;
@ -383,8 +383,7 @@ namespace CalculatorApp
void EnsureScientific() void EnsureScientific()
{ {
// UNO TODO OpsPanel.EnsureScientificOps();
// OpsPanel.EnsureScientificOps();
if (ScientificAngleButtons == null) if (ScientificAngleButtons == null)
{ {
@ -404,12 +403,12 @@ namespace CalculatorApp
this.FindName("ProgrammerDisplayPanel"); this.FindName("ProgrammerDisplayPanel");
} }
// UNO TODO OpsPanel.EnsureProgrammerRadixOps();
// OpsPanel.EnsureProgrammerRadixOps(); // UNO TODO
// ProgrammerOperators.SetRadixButton(Model.GetCurrentRadixType()); // ProgrammerOperators.SetRadixButton(Model.GetCurrentRadixType());
} }
void OnCalcPropertyChanged(object sender, PropertyChangedEventArgs e) void OnCalcPropertyChanged(object sender, PropertyChangedEventArgs e)
{ {
String prop = e.PropertyName; String prop = e.PropertyName;
if (prop == nameof(StandardCalculatorViewModel.IsMemoryEmpty)) if (prop == nameof(StandardCalculatorViewModel.IsMemoryEmpty))

View file

@ -74,7 +74,7 @@ namespace CalculatorApp
} }
} }
void EnsureScientificOps() internal void EnsureScientificOps()
{ {
if (ScientificOperators == null) if (ScientificOperators == null)
{ {
@ -82,7 +82,7 @@ namespace CalculatorApp
} }
} }
void EnsureProgrammerRadixOps() internal void EnsureProgrammerRadixOps()
{ {
if (ProgrammerRadixOperators == null) if (ProgrammerRadixOperators == null)
{ {
@ -90,7 +90,7 @@ namespace CalculatorApp
} }
} }
void EnsureProgrammerBitFlipPanel() internal void EnsureProgrammerBitFlipPanel()
{ {
if (BitFlipPanel == null) if (BitFlipPanel == null)
{ {