RedMooner / BindableTextboxesWPF

Bind your input fields with class fields

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BindableTextboxesWPF

Bind your input fields with class fields

usage

create a model class for your project

public class person : EditBase
{
    public Property<string> name = new Property<string>("name", "some name");
    public string Name
    {
        get
        {
            return name.Value;
        }
        set
        {
            name.SetValue(value);
        }
    }
    public person(string name)
    {
        Name = name;
    }
}

Set textboxes

public partial class MainWindow : Window, IEditWindowBase<person>
{
    public person EntityValue { get; set; }
    public MainWindow()
    {
        InitializeComponent();
        this.EntityValue = new person("Саша Мотырев");
        EntityValue.name.SetTextBox(testlabel);
    }

    private void Button_Click(object sender, RoutedEventArgs e)
    {
        EntityValue.Name = "TEST";
    }
}

About

Bind your input fields with class fields


Languages

Language:C# 100.0%