public CalculatorViewModel()
        {
            _calculator = new CalculatorSimple();
            _operation = Operations.None;

            AddCommand = new ActionCommand(Add);
            SubtractCommand = new ActionCommand(Subtract);
            MultiplyCommand = new ActionCommand(Multiply);
            DivideCommand = new ActionCommand(Divide);
            EquateCommand = new ActionCommand(Equate);

            ZeroCommand = new ActionCommand(() => InputSymbol('0'));
            OneCommand = new ActionCommand(() => InputSymbol('1'));
            TwoCommand = new ActionCommand(() => InputSymbol('2'));
            ThreeCommand = new ActionCommand(() => InputSymbol('3'));
            FourCommand = new ActionCommand(() => InputSymbol('4'));
            FiveCommand = new ActionCommand(() => InputSymbol('5'));
            SixCommand = new ActionCommand(() => InputSymbol('6'));
            SevenCommand = new ActionCommand(() => InputSymbol('7'));
            EightCommand = new ActionCommand(() => InputSymbol('8'));
            NineCommand = new ActionCommand(() => InputSymbol('9'));
            MarkCommand = new ActionCommand(() => InputSymbol(','));

            RemoveLastDigitCommand = new ActionCommand(RemoveLastDigit);
            ClearCommand = new ActionCommand(Clear);
            PlusMinusCommand = new ActionCommand(ChangeSign);
        }
Ejemplo n.º 2
0
 public MainViewModel()
 {
     _random = new Random();
     _themeNames = Directory.GetFiles(@"Themes", "*.xaml");
     CalculatorViewModel = new CalculatorViewModel();
     ChangeThemeCommand = new ActionCommand(ChangeTheme);
 }