我用WPF编写我的界面.我使用ListView作为我的任务列表.任务列表包含两列,FileName,Progress.every绑定到TaskInfo的行:
public class TaskInfo : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public TaskInfo(string fp)
{
FileSystemInfo fsi= new DirectoryInfo(fp);
FileName = fsi.Name;
FilePath = fp;
PbValue = 0;
}
private int pbvalue;
public int PbValue
{
get { return pbvalue; }
set
{
pbvalue = value;
onPropertyChanged("PbValue");
}
}
private string filename;
public string FileName
{
get { return filename;}
set
{
filename = value;
onPropertyChanged("FileName");
}
}
private string filepath;
public string FilePath
{
get { return filepath;}
set …Run Code Online (Sandbox Code Playgroud)