using System.Windows;
using System.Windows.Input;

namespace WpfApp3.Windows
{
    public partial class StudentDetailsWindow : Window
    {
        public Student CurrentStudent { get; set; }

        public StudentDetailsWindow(Student currentStudent)
        {
            InitializeComponent();
            CurrentStudent = currentStudent;
            DataContext = CurrentStudent;
        }

        private void Window_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Escape)
            {
                Close();
            }
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }
    }
}