public class AddDataToLv2
{
public string txt_filename0 { get; set; }
public string txt_filename1 { get; set; }
public string txt_filename2 { get; set; }
public AddDataToLv2(string[] v)
{
txt_filename0 = v[0];
txt_filename1 = v[1];
txt_filename2 = v[2];
}
}
//改为以下方式
class AddDataToListview
{
public string[] alist { get; set; }
public AddDataToListview(string[] data)
{
this.alist = data;
}
}
//xaml界面
<GridViewColumn Header="时间" DisplayMemberBinding="{Binding alist[0]}" Width="160"/>
记录一下:WPF使用实例化对象
于 2023-04-04 14:57:58 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)