Ejemplo n.º 1
0
        public SimpleCalcVM(CalcCore.ICalc calc)
        {
            this.calc = calc;

            Inputs = new List <IOValues>();
            foreach (var item in calc.GetInputs())
            {
                Inputs.Add(new IOValues(item, calc, this));
            }
            Outputs = new ObservableCollection <IOValues>();
            foreach (var item in calc.GetOutputs())
            {
                Outputs.Add(new IOValues(item, calc, this));
            }

            //this.calc = calculation;
            _formulae = new ObservableCollection <FormulaeVM>();
            foreach (var item in calc.GetFormulae())
            {
                _formulae.Add(new FormulaeVM()
                {
                    Expression = item.Expression, Ref = item.Ref, Conclusion = item.Conclusion, Narrative = item.Narrative, Status = item.Status                             /*, Image=item.Image */
                });
            }
        }
Ejemplo n.º 2
0
 public void UpdateOutputs()
 {
     Outputs = new ObservableCollection <IOValues>();
     foreach (var item in calc.GetOutputs())
     {
         Outputs.Add(new IOValues(item, calc, this));
     }
     _formulae = new ObservableCollection <FormulaeVM>();
     foreach (var item in calc.GetFormulae())
     {
         _formulae.Add(new FormulaeVM()
         {
             Expression = item.Expression, Ref = item.Ref, Conclusion = item.Conclusion, Narrative = item.Narrative, Status = item.Status                             /*, Image=item.Image */
         });
     }
     RaisePropertyChanged(nameof(Formulae));
 }