private void btnWallV_Click(object sender, RoutedEventArgs e) { Mesh w; switch (cmbVWalls.SelectedIndex) { case 0: w = MeshFactory.MakeVerticalWall100(this); break; case 1: w = MeshFactory.MakeVerticalWall200(this); break; case 2: w = MeshFactory.MakeVerticalWall400(this); break; default: w = MeshFactory.MakeVerticalWall100(this); break; } w.Init(this); canvasRoom.Children.Add(w); wallLayer.Add(w); if (!(bool)radWalls.IsChecked) { EnableWallsLayer(); radWalls.IsChecked = true; } if (selected != null) { selected.Deselect(); } selected = w; w.Select(); w.SnapToGrid(); }