public void CalculateResult() { try { switch (Operation) { case ("+"): Result = (FirstOperand.ToDouble() + SecondOperand.ToDouble()).ToDisplayString(); break; case ("-"): Result = (FirstOperand.ToDouble() - SecondOperand.ToDouble()).ToDisplayString(); break; case ("*"): Result = (FirstOperand.ToDouble() * SecondOperand.ToDouble()).ToDisplayString(); break; case ("/"): Result = (FirstOperand.ToDouble() / SecondOperand.ToDouble()).ToDisplayString(); break; case ("%"): Result = (FirstOperand.ToDouble() * SecondOperand.ToDouble() / 100D).ToDisplayString(); break; case ("√"): Result = Math.Sqrt(SecondOperand.ToDouble()).ToDisplayString(); break; case ("1/x"): Result = (1 / (SecondOperand.ToDouble())).ToDisplayString(); break; } } catch (Exception) { Result = "Error"; } }