You can write c# code to set the next rectangle based on previous one. Modified code will be:
static double prevLoc = 0;
void b_Click(object sender, RoutedEventArgs e)
{
Rectangle rectangle = new Rectangle();
rectangle.Fill = new SolidColorBrush(Colors.Cyan);
rectangle.Width = 200;
rectangle.Height = 100;
rectangle.SetValue(Canvas.LeftProperty, prevLoc);
prevLoc += 25;
LayoutRoot.Children.Add(rectangle);
}