title: Removing Elements Programmatically in Silverlight
body: <p>I am starting to learn silverlight and to practice I am doing a simple space invaders type videogame.</p>
  
  <p>My issue is I am creating custom controls (bullets) programmatically like so:</p>
  
  <pre><code>if(shooting)
  {
      if(currBulletRate == bulletRate)
      {
          Bullet aBullet = new Bullet();
  
          aBullet.X = mouse.X - 5;
          aBullet.Y = mouse.Y - Ship.Height;
          aBullet.Width = 10;
          aBullet.Height = 40;
          aBullet.Tag = "Bullet";
  
          LayoutRoot.Children.Add(aBullet);
  
          currBulletRate = 0;
      }
      else
          currBulletRate++;
  }
  </code></pre>
  
  <p>However I am having trouble removing them once they go off bounds (leave the LayoutRoot).</p>
  
  <p>I tried looping throught the LayoutRoot.Children and removing but I can't seem to get it right.</p>