void ChooseTitle() { foreach (var temp in MainWindow.BtnShape) { if (temp.Value) { switch (temp.Key) { case "btnEllipse": Title = "Draw a Ellipse"; ShapeToDraw = MyShapeEnum.Elipse; EllipseWind(); break; case "btnRectangle": Title = "Draw a Rectangle"; ShapeToDraw = MyShapeEnum.Rectangle; RectangleWind(); break; case "btnPolygon": Title = "Draw a Polygon"; ShapeToDraw = MyShapeEnum.Polygon; PolygonWind(); break; case "btnImage": Title = "Draw a Image"; ShapeToDraw = MyShapeEnum.Image; ImageWind(); break; } } } }
public ChangePropertiesWindow(MyShape shape, MyShapeEnum myShapeEnum) { imgPath = ""; InitializeComponent(); cbBorder.ItemsSource = typeof(Colors).GetProperties(); cbFill.ItemsSource = typeof(Colors).GetProperties(); AllButons = new List <Button>() { btnCancel, btnDraw, btnFindImage }; this.myShapeEnum = myShapeEnum; ShapeToChange = shape; ChooseTitle(); ChoseWindowsElelment(); }