public StudFulInfo(MainWindow mw, Students obj) { MainForm = mw; mw.DelStFullInfo(); this.InitializeComponent(); this.fio.IsEnabled = false; this.propiska_st.IsEnabled = false; this.faktAddr_st.IsEnabled = false; this.PassportVidan_st.IsEnabled = false; this.PassportNum_st.IsEnabled = false; this.snils_st.IsEnabled = false; this.birth_st.IsEnabled = false; this.baza_st.IsEnabled = false; this.forma_st.IsEnabled = false; this.datePodachi_st.IsEnabled = false; this.add_foto.IsEnabled = false; this.status_st.IsEnabled = false; combo_st.ItemsSource = Status.massiv; Student = obj; ImageSelect(); LayoutRoot.DataContext = Student; // для биндинга #region Привязка события LostFocus для обновления контента this.snils_st.LostFocus += (s, e) => { SavData(Students.EditUpdate(Id, snils_st.Text, snils_st.Name)); }; this.PassportNum_st.LostFocus += (s, e) => { SavData(Students.EditUpdate(Id, PassportNum_st.Text, PassportNum_st.Name)); }; this.PassportVidan_st.LostFocus += (s, e) => { SavData(Students.EditUpdate(Id, PassportVidan_st.Text, PassportVidan_st.Name)); }; this.propiska_st.LostFocus += (s, e) => { SavData(Students.EditUpdate(Id, propiska_st.Text, propiska_st.Name)); }; this.faktAddr_st.LostFocus += (s, e) => { SavData(Students.EditUpdate(Id, faktAddr_st.Text, faktAddr_st.Name)); }; this.forma_st.LostFocus += (s, e) => { SavData(Students.EditUpdate(Id, forma_st.Text, forma_st.Name)); }; this.birth_st.LostFocus += (s, e) => { SavData(Students.EditUpdate(Id, birth_st.Text, birth_st.Name)); }; this.datePodachi_st.LostFocus += (s, e) => { SavData(Students.EditUpdate(Id, datePodachi_st.Text, datePodachi_st.Name)); }; this.fio.KeyDown += (s, e) => {if (Lname != null) SavData(Students.EditUpdate(Id, Lname, "lname_st")); if (Sname != null) SavData(Students.EditUpdate(Id, Sname, "sname_st")); if (Fname != null) SavData(Students.EditUpdate(Id, Fname, "fname_st")); }; //this.oplata_st.LostFocus += (s, e) => { SavData(Students.EditUpdate(Id, oplata_st.Text, oplata_st.Name)); }; #endregion }
public Main_openForm(MainWindow mw) { this.InitializeComponent(); Mw = mw; }