//用于在属性更改时通知侦听器
public class BaseDto : INotifyPropertyChanged
{
public int Id { get; set; }
//通知属性更改的事件
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// 实现通知更新
/// </summary>
public void OnPropertyChanged([CallerMemberName] string propertyName = "")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
3.在文件夹中创建类DailyDto
public class DailyDto : BaseDto
{
private int id;
private string title;
public int Id
{
get { return id; }
set
{
id = value;
OnPropertyChanged();
}
}
public string Title
{
get { return title; }
set { title = value; OnPropertyChanged(); }
}
}
4. 在文件夹中创建类Page
public class Page
{
public int PageIndex { get; set; } // 当前页码
public int PageSize { get; set; } // 每页记录数
}
5.在类库创建类ToDoParameter
public class ToDoParameter : Page
{
public int? Status { get; set; }
}