title: How to access to line that i have created on run-time by its name like created before run-time in wpf?
body: <p>this is function to make line with 4 points that give it place and name </p>
  
  <pre><code>int counter=0; 
  public void CreateALine(double po1, double po2, double po3, double po4)
      {
          // Create a Line
          Line redLine = new Line();
          redLine.X1 = po1;
          redLine.Y1 = po2;
          redLine.X2 = po3;
          redLine.Y2 = po4;
  
          // Create a red Brush
          SolidColorBrush redBrush = new SolidColorBrush();
          redBrush.Color = Colors.Red;
  
          // Set Line's width and color
          redLine.StrokeThickness = 3;
          redLine.Stroke = redBrush;
  
          // Add line to the Grid.
          LayoutRoot.Children.Add(redLine);
          LayoutRoot.RegisterName("readline"+counter, redLine);
          counter++;            
      }
  </code></pre>
  
  <p>I want to create more than one line, 
  Could i access to any line by its name?
  to make an event or control its Visibility
  like this :</p>
  
  <pre><code>      redline0.Visibility = Visibility.Collapsed;
        redline1.Visibility = Visibility.Visible;
  </code></pre>