最近在做WPF项目,对wpf界面的listview进行数据绑定,并根据绑定行的数据属于的类型在listview的一列中用不同的图片进行区分。
好的,现在说一下具体使用步骤:
第一步,先定义要绑定列表需要的集合数据的类
public class FtpFileInformation
{
private bool isDirectory;
private string filename;
private string filetime;
private int filesize;
public bool IsDirectory
{
get { return isDirectory; }
set
{
isDirectory = value;
this.OnPropertyChanged(IsDirectory.ToString());
}
}
public string Filename
{
get { return filename; }
set
{
filename = value;
this.OnPropertyChanged(Filename);
}
}
public string Filetime
{
get { return filetime; }
set
{
filetime = value;
this.OnPropertyChanged(Filetime);
}
}
pub
好的,现在说一下具体使用步骤:
第一步,先定义要绑定列表需要的集合数据的类
public class FtpFileInformation
{
private bool isDirectory;
private string filename;
private string filetime;
private int filesize;
public bool IsDirectory
{
get { return isDirectory; }
set
{
isDirectory = value;
this.OnPropertyChanged(IsDirectory.ToString());
}
}
public string Filename
{
get { return filename; }
set
{
filename = value;
this.OnPropertyChanged(Filename);
}
}
public string Filetime
{
get { return filetime; }
set
{
filetime = value;
this.OnPropertyChanged(Filetime);
}
}
pub