title: Getting name for a WPF shape from variable
body: <p>I want to initialize and show a ellipse (WPF shape) in a function.The name of the ellipse should be given to the function as a parameter. </p>
  
  <p>Is there a possibility to do something like that ?</p>
  
  <p>Edit:</p>
  
  <p>The following is given:</p>
  
  <pre><code>private void A1_Click(object sender, RoutedEventArgs e)
      {
          textBox1.Text = "Feld A1 gedrückt";            
          //Spielstein setzen
          //Rêgeln überprüfen
          myEllipse = new Ellipse();
          myEllipse.Fill = System.Windows.Media.Brushes.Black;
          myEllipse.HorizontalAlignment = HorizontalAlignment.Left;
          myEllipse.VerticalAlignment = VerticalAlignment.Top;
          myEllipse.Margin = new Thickness(2, 2, 0, 0);
          myEllipse.Width = 45;
          myEllipse.Height = 45;
          grid3.Children.Add(myEllipse);
          A1.IsHitTestVisible = false;
  
      }
  </code></pre>
  
  <p>What I want to do is to get the name("myEllipse") from a string variable. For example:</p>
  
  <pre><code>string name = 'myEllipse';
  name = newEllipse();
  myEllipse.Fill = System.Windows.Media.Brushes.Black;
  </code></pre>