Beispiel #1
0
        public MainViewModel()
        {
            FillDirectory();

            calcDeligate = model.addition;

            TypeCommand  = new Command(arg => TypeMethod(arg));
            ClearCommand = new Command(arg => ClearMethod());

            SetOperatorCommand = new Command(arg => SetOperatorMethod(arg));

            SetFirstStringActiveCommand  = new Command(arg => SetFirstStringActiveMethod());
            SetSecondStringActiveCommand = new Command(arg => SetSecondStringActiveMethod());

            ChangeActiveStringCommand = new Command(arg => ChangeActiveStringMethod());

            SetDefaultValues();
        }
Beispiel #2
0
        private void FillDirectory()
        {
            dirOperButtons.Add("plus", arg =>
            {
                PlusOperatorButtonColor = arg;

                if (arg == ORANGE_RED_BRUSH)
                {
                    calcDeligate = model.addition;
                    ChangeStringsValues();
                }
            });

            dirOperButtons.Add("minus", arg =>
            {
                MinusOperatorButtonColor = arg;
                if (arg == ORANGE_RED_BRUSH)
                {
                    calcDeligate = model.subtraction;
                    ChangeStringsValues();
                }
            });

            dirOperButtons.Add("division", arg =>
            {
                DivisionOperatorButtonColor = arg;
                if (arg == ORANGE_RED_BRUSH)
                {
                    calcDeligate = model.division;
                    ChangeStringsValues();
                }
            });

            dirOperButtons.Add("multiply", arg =>
            {
                MultiplyOperatorButtonColor = arg;
                if (arg == ORANGE_RED_BRUSH)
                {
                    calcDeligate = model.multiplicate;
                    ChangeStringsValues();
                }
            });

            dirOperButtons.Add("square", arg =>
            {
                SquareOperatorButtonColor = arg;
                if (arg == ORANGE_RED_BRUSH)
                {
                    calcDeligate = model.square;
                }
            });

            dirOperButtons.Add("percent", arg =>
            {
                PercentOperatorButtonColor = arg;
                if (arg == ORANGE_RED_BRUSH)
                {
                    calcDeligate = model.percent;
                }
            });
        }