记录一下,控件绑定步骤:1.新建一个类(假设是person)在Observable里定义一个变量(假设是people)
2.令people = new observable
3.在listbox.ItemsSource = people;
4.在按钮定义变量:变量.Add(new person(textbox.text))
5.定义类person如下:public string a {get;set;}
public string b {get;set;}
public.person(string a,string b)
{this.a = a;this.b=b;
}
(其中a,b为要关联的textbox 的名字)
注:为防止出现其他如路径等不需要文字在控件上,进行复写,代码如下:
public override string Tostring();
{ return(this,a); return(this,b);
}



