using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Sched.CustomClasses;
using Sched.CustomControls;
using Sched.CustomSubwindows;

namespace Sched.CustomDialogs
{
    /// <summary>
    /// Interaction logic for LessonBoxDialog.xaml
    /// </summary>
    public partial class LessonBoxDialog : Window
    {
        Lesson LessonDA;
        public LessonBoxDialog(object DA)
        {
            LessonDA = new Lesson(((AssignmentData)DA).Lssn);
            DataContext = DA;
            InitializeComponent();

            Loaded += Window_Loaded;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            AssignPanel.GB_Assignment.IsEnabled = false;
            AssignPanel.GB_Lesson.Visibility = Visibility.Visible;
            AssignPanel.TB_Hours.IsEnabled = false;
            AssignPanel.DP_StartDate.IsEnabled = false;

            ((AssignmentData)DataContext).Lssn = LessonDA;
            AssignPanel.ME_Panel.FillSubgrids();
        }
        private void ButtonOK_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = true;
            Close();
        }

        private void ButtonCancel_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
            Close();
        }
    }
}
