title: The name 'name' does not exist in the current context
body: <p>I am currently doing the Xamarin.iOS tutorial and I cant seem to get around this problem. </p>
  
  <pre><code> translatedNumber = PhoneTranslator.ToNumber(PhoneNumberText.Text);
  </code></pre>
  
  <p>VS2015 underlines PhoneTranslator and gives me the following error:
  "The name PhoneTranslator does not exist in the current context"</p>
  
  <p>Both the ViewController class and the PhoneTranslator class are using the same namespace. How can I fix this? Any suggestions?</p>
  
  <p>It worked after a forced restart of the computer. Don't know why it didn't work in the first place.</p>
  
  <pre><code>namespace Phoneword
  {
      public static class PhoneTranslator
      {
          public static string ToNumber(string raw)
          {
              if (string.IsNullOrWhiteSpace(raw))
              {
                  return "";
              }
              else
              {
                  raw = raw.ToUpperInvariant();
              }
  
              var newNumber = new StringBuilder();
              foreach (var c in raw)
              {
                  if (" -0123456789".Contains(c))
                  {
                      newNumber.Append(c);
                  }
                  else
                  {
                      var result = TranslateToNumber(c);
                      if (result != null)
                      {
                          newNumber.Append(result);
                      }
                  }
                  // otherwise we've skipped a non-numeric char
              }
              return newNumber.ToString();
          }
  
          static bool Contains(this string keyString, char c)
          {
              return keyString.IndexOf(c) &gt;= 0;
          }
  
          static int? TranslateToNumber(char c)
          {
              if ("ABC".Contains(c))
              {
                  return 2;
              }
              else if ("DEF".Contains(c))
              {
                  return 3;
              }
              else if ("GHI".Contains(c))
              {
                  return 4;
              }
              else if ("JKL".Contains(c))
              {
                  return 5;
              }
              else if ("MNO".Contains(c))
              {
                  return 6;
              }
              else if ("PQRS".Contains(c))
              {
                  return 7;
              }
              else if ("TUV".Contains(c))
              {
                  return 8;
              }
              else if ("WXYZ".Contains(c))
              {
                  return 9;
              }
              return null;
          }
      }
  }
  
  namespace Phoneword {
      public partial class ViewController : UIViewController
      {
          public ViewController(IntPtr handle) : base(handle)
          {
          }
  
          public override void ViewDidLoad()
          {
              base.ViewDidLoad();
              // Perform any additional setup after loading the view, typically from a nib.
              string translatedNumber = "";
  
              TranslateButton.TouchUpInside += (object sender, EventArgs e) =&gt; {
  
                  // Convert the phone number with text to a number
                  // using PhoneTranslator.cs
                  translatedNumber = PhoneTranslator.ToNumber(PhoneNumberText.Text);
  
                  // Dismiss the keyboard if text field was tapped
                  PhoneNumberText.ResignFirstResponder();
  
                  if (translatedNumber == "")
                  {
                      CallButton.SetTitle("Call", UIControlState.Normal);
                      CallButton.Enabled = false;
                  }
                  else
                  {
                      CallButton.SetTitle("Call " + translatedNumber, UIControlState.Normal);
                      CallButton.Enabled = true;
                  }
              };
  
              CallButton.TouchUpInside += (object sender, EventArgs e) =&gt; &amp;gt;
              {
                  var url = new NSUrl("tel:" + translatedNumber);
  
                  // Use URL handler with tel: prefix to invoke Apple's Phone app,
                  // otherwise show an alert dialog
  
                  if (!UIApplication.SharedApplication.OpenUrl(url))
                  {
                      var alert = UIAlertController.Create("Not supported", "Scheme 'tel:' is not supported on this device", UIAlertControllerStyle.Alert);
                      alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null));
                      PresentViewController(alert, true, null);
                  }
              };
          }
  
          public override void DidReceiveMemoryWarning()
          {
              base.DidReceiveMemoryWarning();
              // Release any cached data, images, etc that aren't in use.
          }
      } }
  </code></pre>