private void simpleButton1_Click(object sender, EventArgs e) { MainModel model = new MainModel { textEdit1 = "sample", buttonEdit1 = "butonedt", checkedComboBoxEdit1 = "Item1, Item3", comboBoxEdit1 = 1, comboBoxEdit2 = "ShowItemFromText2" }; ControlBindingExtension.GetFromModel(Controls, ref model); }
private void button1_Click(object sender, EventArgs e) { MainModel model = new MainModel { textBox1 = "ahmetfarukulu", comboBox1 = 2, checkBox1 = true, dateTimePicker1 = new DateTime(2020, 1, 1), numericUpDown1 = 16, maskedTextBox1 = "21345642", Name = "John Doe" }; ControlBindingExtension.GetFromModel(Controls, ref model); }