title: How Do I only accept Numeric Digits in C# Xamarin
body: <p>I'm New to C# with Xamarin. Im using Visual Studio for Mac Preview to work on an iOS app.
  When Making a basic calculator I can't figure out how to not accept answers that aren't a numeric digit. For example in my Text box if I put in a letter I want an error that says</p>
  
  <blockquote>
    <p>"Please enter a numeric digit".</p>
  </blockquote>
  
  <p>I don't know why I'm getting an error but its not working.</p>
  
  <p>When I run it and put in a number it just defaults to the else statement every time. Also with Letters. And when I put too many letters in it crashes.</p>
  
  <pre><code>    partial void AddButton_TouchUpInside(UIButton sender)
      {
          double number1 = 0.00;
          double answer = 0.00;
          double number2 = 0.00;
  
          int value;
          string input = Console.ReadLine();
          if (Int32.TryParse(input, out value))
          {
              number1 = double.Parse(Number1TextBox.Text);
              number2 = double.Parse(Number2TextBox.Text);
              answer = number1 + number2;
              AnswerLabel.Text = "The answer is: " + answer.ToString();                             
          }
          else
          {
  
              InvalidLabel.Text = "Please enter a Numeric Digit";
          }
      }   
  </code></pre>