private void menuNew_Click(object sender, RoutedEventArgs e) { //TODO: check if current map needs to be saved MapDimensions askdims = new MapDimensions(); askdims.ShowDialog(); currentMap = new MapModel(askdims.Breedte, askdims.Hoogte); LoadMapOnView(); }
private void menuNew_Click(object sender, RoutedEventArgs e) { if (map.MapExists) { Warning warning = new Warning("Er is een actieve map wilt u deze eerste opslaan?", "Opslaan huidige map", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning); warning.CurrentMap = map; warning.SaveNewMapWarning(); } else { MapDimensions askdims = new MapDimensions(); askdims.ShowDialog(); map.CurrentMap = new MapModel(askdims.Breedte, askdims.Hoogte); map.MapCanvas.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, (ThreadStart) delegate { map.RenderMap(); }); } }
public void SaveNewMapWarning() { if (result == MessageBoxResult.Yes) { currentMap.SaveMap(); MapDimensions askdims = new MapDimensions(); askdims.ShowDialog(); currentMap.CurrentMap = new MapModel(askdims.Breedte, askdims.Hoogte); currentMap.RenderMap(); } if (result == MessageBoxResult.No) { MapDimensions askdims = new MapDimensions(); askdims.ShowDialog(); currentMap.CurrentMap = new MapModel(askdims.Breedte, askdims.Hoogte); currentMap.RenderMap(); } if (result == MessageBoxResult.Cancel) { } }