private void CreateRectButton_Click(object sender, RoutedEventArgs e) { IShapeFactory factory = GetFactory(); var rect = factory.createRect(); tbk.Text = rect.ToString(); }