Exemplo n.º 1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter.GetType() == typeof(EquationHandler))
            {
                equationHandler = e.Parameter as EquationHandler;

                equationHandler.equationText = this.Equation;

                equationHandler.CursorUpdate();

                CheckAngleType();
            }
            else
            {
                equationHandler = new EquationHandler(this.Equation);

                DispatcherTimer timer = new DispatcherTimer();

                timer.Interval = TimeSpan.FromSeconds(0.5);
                timer.Tick += new EventHandler<object>(Timer_Tick);
                timer.Start();
            }

            this.Frame.KeyDown += Equation_KeyDown;
            this.Frame.KeyUp += Equation_KeyUp;
        }
Exemplo n.º 2
0
        public Equation(String equation, EquationHandler equationHandler)
        {
            this.equation = equation;
            this.equationHandler = equationHandler;

            Tokenize();
            EvaluateTokens();
        }