using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Blueprinter
{
    public static class TextBoxExtensions
    {
        public static void Bind(this TextBox tb, BindingSource data, string propertyName)
        {
            var binding = new Binding("Text", data, propertyName);
            binding.ControlUpdateMode = ControlUpdateMode.OnPropertyChanged;

            tb.DataBindings.Add(binding);

        }
    }
}
