private void NewHeigtMap_Click(object sender, RoutedEventArgs e) { var vm = DataContext as MainViewModel; if (ViewModel.Machine.PCBManager.HasProject && ViewModel.Machine.PCBManager.HasBoard) { var heightMap = new HeightMap(ViewModel.Machine, ViewModel.Logger); heightMap.Min = new Core.Models.Drawing.Vector2(ViewModel.Machine.PCBManager.Project.ScrapSides, ViewModel.Machine.PCBManager.Project.ScrapTopBottom); heightMap.Max = new Core.Models.Drawing.Vector2(ViewModel.Machine.PCBManager.Board.Width + ViewModel.Machine.PCBManager.Project.ScrapSides, ViewModel.Machine.PCBManager.Board.Height + ViewModel.Machine.PCBManager.Project.ScrapTopBottom); heightMap.GridSize = ViewModel.Machine.PCBManager.Project.HeightMapGridSize; ViewModel.Machine.HeightMapManager.NewHeightMap(heightMap); } else { var newHeightMapWindow = new NewHeightMapWindow(this, ViewModel.Machine, false); if (newHeightMapWindow.ShowDialog().HasValue&& newHeightMapWindow.DialogResult.Value) { ViewModel.Machine.HeightMapManager.NewHeightMap(newHeightMapWindow.HeightMap); } } }
private void EditHeightMap_Click(object sender, RoutedEventArgs e) { var newHeightMapWindow = new NewHeightMapWindow(this, ViewModel.Machine, true); newHeightMapWindow.ShowDialog(); }