Workers.xaml.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. namespace LR1
  16. {
  17. /// <summary>
  18. /// Логика взаимодействия для Workers.xaml
  19. /// </summary>
  20. public partial class Workers : Page
  21. {
  22. public Workers()
  23. {
  24. InitializeComponent();
  25. }
  26. private bool isDirty = true;
  27. private bool isLoaded = false;
  28. private void UndoCommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)
  29. {
  30. e.CanExecute = isLoaded;
  31. }
  32. private void UndoCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
  33. {
  34. MessageBox.Show("Отмена");
  35. isDirty = true;
  36. isLoaded = false;
  37. }
  38. private void DeleteCommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)
  39. {
  40. e.CanExecute = isDirty;
  41. }
  42. private void DeleteCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
  43. {
  44. MessageBox.Show("Удаление");
  45. isDirty = false;
  46. isLoaded = true;
  47. }
  48. private void AddCommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)
  49. {
  50. e.CanExecute = isDirty;
  51. }
  52. private void AddCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
  53. {
  54. MessageBox.Show("Создание");
  55. isDirty = false;
  56. isLoaded = true;
  57. }
  58. private void EditCommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)
  59. {
  60. e.CanExecute = isDirty;
  61. }
  62. private void EditCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
  63. {
  64. MessageBox.Show("Редактирование");
  65. isDirty = false;
  66. isLoaded = true;
  67. }
  68. private void FindCommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)
  69. {
  70. e.CanExecute = isDirty;
  71. }
  72. private void FindCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
  73. {
  74. MessageBox.Show("Поиск");
  75. isDirty = false;
  76. isLoaded = true;
  77. }
  78. private void SaveCommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)
  79. {
  80. e.CanExecute = isLoaded;
  81. }
  82. private void SaveCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
  83. {
  84. MessageBox.Show("Сохра");
  85. isDirty = true;
  86. isLoaded = false;
  87. }
  88. }
  89. }