public BaseCalculatorViewModel()
        {
            _calcMemory        = new CalcMemory();
            _instance          = new HistoryInvoker();
            _controlExpression = new ControlExpression(new BaseValidator());//does not work fully right, because it need normal regexp

            InitCalculator();
            AddMemoryFunc();
        }
        private void InitCalculator()
        {
            if (Manager.HistoryAndMemoryContainer != null)
            {
                _calcMemory = Manager.HistoryAndMemoryContainer.CalcMemory;
                _instance   = Manager.HistoryAndMemoryContainer.HistoryInvoker;

                _lvl      = _instance.Count() - 1;
                _position = _lvl;

                //init fields
                Memory     = _calcMemory.Memory.ToString();
                Expression = _instance.ReadLast();
            }
            else
            {
                Memory     = "0";
                Expression = "0";
            }
        }
Example #3
0
 public MainWindowViewModel()
 {
     _calcMemory = new CalcMemory();
     _instance   = new HistoryInvoker();
     _symbols    = Shell.GetSymbols();
 }