private EditControl AddControl(string text) { EditControl editControl = new EditControl(); editControl.textLabel.Text = text; editPanel.Children.Add(editControl); return(editControl); }
//Fname, Lname, Phone, Addr, Email public EditWindow(Window Owner, DataBaseItem dataBaseItem) { this.Owner = Owner; InitializeComponent(); firstname = AddControl("Имя:"); phone = AddControl("Телефон:"); email = AddControl("Email:"); if (dataBaseItem != null) { this.dataBaseItem = dataBaseItem; firstname.textEdit.Text = dataBaseItem.firstName; phone.textEdit.Text = dataBaseItem.phone; email.textEdit.Text = dataBaseItem.email; } }