I'm trying out wpf and i want to be able to create shapes by left clicking, but have the right click remove the shape the mouse-pointer is currently hovering over, however, what happens instead is the last shape created is removed. How do I fix this? 

This creates the shape:

```
 private List<Shape> shapes = new List<Shape>();
    private Shape shape;
    public static Random rand = new Random();

    private Rectangle CreateRectangle()
    {

        int height = rand.Next(0, 151);
        int width = rand.Next(0, 101);
        byte alpha = (byte)rand.Next(0, 256);
        byte alpha2 = (byte)rand.Next(0, 256);
        byte alpha3 = (byte)rand.Next(0, 256);
        Rectangle rect = new Rectangle();
        rect.Width = width;
        rect.Height = height;
        SolidColorBrush color = new SolidColorBrush();
        color.Color = Color.FromRgb(alpha, alpha2, alpha3);
        rect.Fill = color;
        return rect;
    }

    private Ellipse CreateEllipse()
    {

        int height = rand.Next(0, 151);
        int width = rand.Next(0, 101);
        byte alpha = (byte)rand.Next(0, 256);
        byte alpha2 = (byte)rand.Next(0, 256);
        byte alpha3 = (byte)rand.Next(0, 256);
        Ellipse ellipse = new Ellipse();
        ellipse.Width = width;
        ellipse.Height = height;
        SolidColorBrush color = new SolidColorBrush();
        color.Color = Color.FromRgb(alpha, alpha2, alpha3);
        ellipse.Fill = color;
        return ellipse;

    }

    private void ColumnDefinition_OnClick(object sender, MouseButtonEventArgs e)
    {
        Point area = System.Windows.Input.Mouse.GetPosition(mc);
        int num = rand.Next(1, 3);
        switch (num)
        {
            case 1:
              shape = CreateRectangle();

                mc.Children.Add(shape);
                shapes.Add(shape);
                Canvas.SetLeft(shape, area.X);
                Canvas.SetTop(shape, area.Y);
                break;
            case 2:
                shape = CreateEllipse();
                 mc.Children.Add(shape);
                shapes.Add(shape);
                Canvas.SetLeft(shape, area.X);
                Canvas.SetTop(shape, area.Y);
                break;
        }
    }

    private void Clear_Click(object sender, RoutedEventArgs e)
    {
        mc.Children.Clear();
    }

```

This is whats supposed to remove the shape: 

```
    private void mc_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
    {

        mc.Children.Remove(shape);
        shapes.Remove(shape);
    }
}

```

}

Any help is greatly appreciated.