using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DataBindingDemo;

namespace BindingDemoUI
{
    public partial class Form1 : Form
    {
        private Employee prof;
        public Form1()
        {
            InitializeComponent();
            prof=new Employee();
            this.labelName.DataBindings.Add(new Binding("Text", prof, "Name", false, DataSourceUpdateMode.Never));
            this.labelFirstName.DataBindings.Add(new Binding("Text", prof, "FirstName", false, DataSourceUpdateMode.Never));
            prof.Name = "Bravo";
            prof.FirstName = "Juan";
        }


        private void btnChangeName_Click(object sender, EventArgs e)
        {
            prof.Name="Arlotto";
        }

        private void btnChangeFirstName_Click(object sender, EventArgs e)
        {
            prof.FirstName = "Philippe";
        }

    }
}
