using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Text;

namespace TodoXaml.Models
{
    public class TodoItem : INotifyPropertyChanged
    {
        private DateTimeOffset _deadline;
        private string _description = string.Empty;
        private int _id;
        private bool _isDone;
        private string _title = string.Empty;
        private Priority _priority;

        public DateTimeOffset Deadline
        {
            get => _deadline;
            set { _deadline = value; OnPropertyChanged(); }
        }
        public string Description
        {
            get => _description;
            set { _description = value; OnPropertyChanged(); }
        }
        public int Id
        {
            get => _id;
            set { _id = value; OnPropertyChanged(); }
        }
        public bool IsDone
        {
            get => _isDone;
            set { _isDone = value; OnPropertyChanged(); }
        }
        public string Title
        {
            get => _title;
            set { _title = value; OnPropertyChanged(); }
        }
        public Priority Priority
        {
            get => _priority;
            set { _priority = value; OnPropertyChanged(); }
        }

        public event PropertyChangedEventHandler? PropertyChanged;
        private void OnPropertyChanged([CallerMemberName] string? name = null)
            => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
    }

    public enum Priority
    {
        Low,
        Normal,
        High
    }
}
