private void OK_OnClick(object sender, RoutedEventArgs e) { if (lw != null) { lw.Close(); } m.setLandmarks(AvailableLandmarks); m.copyLandmarks(ancestor.tempLandmarks); m.setPlacedLandmarks(); MapWindow.notSaved = true; doNotShow = true; this.Close(); }
private void Exit_OnClick(object sender, RoutedEventArgs e) { if (ltw1 != null) { ltw1.Close(); } if (ltw != null) { ltw.Close(); } if (lw != null) { lw.Close(); } if (llw != null) { llw.Close(); } MessageBoxResult mbr1 = MessageBox.Show("Are you sure you want to exit?", "Exit", MessageBoxButton.YesNo, MessageBoxImage.Question); if (mbr1 == MessageBoxResult.Yes) { if (notSaved) { MessageBoxResult mbr = MessageBox.Show("You have not saved your data. \nDo you want to save first?", "Save", MessageBoxButton.YesNo, MessageBoxImage.Exclamation); if (mbr == MessageBoxResult.Yes) { saveAll(); } } doNotShow = true; this.Close(); } }