46 lines
967 B
C#
46 lines
967 B
C#
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;
|
|
}
|
|
}
|