DetailWindow.xaml.cs 987 B

123456789101112131415161718192021222324252627282930313233343536373839
  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.Shapes;
  14. using wpf_listbox.models;
  15. namespace wpf_listbox.Windows
  16. {
  17. public partial class DetailWindow : Window
  18. {
  19. public People currentPeople { get; set; }
  20. // конструктор класса окна
  21. public DetailWindow(People currentPeople)
  22. {
  23. // и инициализируем в конструкторе
  24. this.currentPeople = currentPeople;
  25. InitializeComponent();
  26. DataContext = this.currentPeople;
  27. }
  28. private void ExitButton_Click(object sender, RoutedEventArgs e)
  29. {
  30. this.DialogResult = true;
  31. }
  32. }
  33. }