title: How to reference "Automatic" Properties in my class?
body: <p>The tutorial I'm following (<a href="http://www.bluerosegames.com/xna101/post/Lesson-9-Improving-the-BouncingBall-Class-Using-Properties.aspx" rel="nofollow">http://www.bluerosegames.com/xna101/post/Lesson-9-Improving-the-BouncingBall-Class-Using-Properties.aspx</a>)</p>
  
  <pre><code>private Vector2 _position;
  public Vector2 Position
  {
      get
  
      {
          return _position;
      }
      set
      {
          _position = value;
      }
  }
  </code></pre>
  
  <p>does not use the automatic properties feature in the code. I'd like to skip most of the typing using the automatic properties but I have problems later on in the code. I've commented the lines below that are affected.</p>
  
  <pre><code>public Vector2 Position { get; set; }
  
      public void Update()
      {
          Position = Position + Velocity;
  
          if (Position.X &lt; 0 || Position.X &gt; GraphicsViewport.Width - Texture.Width)
          {
              // If we get in here, we've hit a vertical wall
              Velocity.X = -Velocity.X; // doesn't work
              Position.X = Position.X + Velocity.X; // doesn't work
          }
          if (Position.Y &lt; 0 || Position.Y &gt; GraphicsViewport.Height - Texture.Height)
          {
              // If we get in here, we've hit a horizontal wall
              Velocity.Y = -Velocity.Y; // doesn't work
              Position.Y = Position.Y + Velocity.Y; // doesn't work
          } 
      }
  </code></pre>
  
  <p>The error that I get in Visual Studio states that "Cannot modify the return value of WindowsGame1.BouncingBall.Position' because it is not a variable." So how can I get the code to work with the automatic properties?</p>
  
  <p>Thank you!
  John</p>