AddPointToRouteWindow.xaml.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Linq;
  2. using System.Windows;
  3. using System.Windows.Input;
  4. namespace Kusach.Windows
  5. {
  6. /// <summary>
  7. /// Логика взаимодействия для AddPointToRouteWindow.xaml
  8. /// </summary>
  9. public partial class AddPointToRouteWindow : Window
  10. {
  11. int routeId;
  12. public AddPointToRouteWindow(int id)
  13. {
  14. InitializeComponent();
  15. routeId = id;
  16. PointsListDataGrid.ItemsSource = cnt.db.Points.ToList();
  17. }
  18. public int pointId = -1;
  19. private void PointsDataGridRow_MouseDoubleClick(object sender, MouseButtonEventArgs e)
  20. {
  21. pointId = ((Points)PointsListDataGrid.SelectedItem).IdPoint;
  22. this.Close();
  23. }
  24. private void CreateButton_Click(object sender, RoutedEventArgs e)
  25. {
  26. AddPointWindow apw = new AddPointWindow(routeId);
  27. apw.ShowDialog();
  28. this.Close();
  29. }
  30. private void BackButton_Click(object sender, RoutedEventArgs e)
  31. {
  32. this.Close();
  33. }
  34. }
  35. }