添加项目文件。
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Text.Json.Serialization;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace TodoList.Models
|
||||
{
|
||||
public enum TodoPriority
|
||||
{
|
||||
[Description("低")]
|
||||
Low,
|
||||
[Description("中")]
|
||||
Medium,
|
||||
[Description("高")]
|
||||
High
|
||||
}
|
||||
|
||||
public enum SyncStatus
|
||||
{
|
||||
Synced,
|
||||
Pending,
|
||||
Failed
|
||||
}
|
||||
|
||||
public partial class TodoItem : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private string id = Guid.NewGuid().ToString();
|
||||
|
||||
[ObservableProperty]
|
||||
private string content = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isCompleted;
|
||||
|
||||
[ObservableProperty]
|
||||
private TodoPriority priority = TodoPriority.Medium;
|
||||
|
||||
[ObservableProperty]
|
||||
private DateTime createdAt = DateTime.Now;
|
||||
|
||||
[ObservableProperty]
|
||||
private SyncStatus syncStatus = SyncStatus.Pending;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user