Complete TodoApp sample application with: - App.xaml/cs: Colors and styles for light/dark themes - TodoListPage: Task list with theme toggle switch - NewTodoPage: Form to create new tasks - TodoDetailPage: Edit task details with delete option - TodoItem.cs/TodoService.cs: Data model and service - SVG icons for save, delete, and add actions Theme switching via toggle on main page applies app-wide. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
48 lines
1.1 KiB
C#
48 lines
1.1 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
|
|
namespace TodoApp;
|
|
|
|
public class TodoItem : INotifyPropertyChanged
|
|
{
|
|
private string _title = "";
|
|
private string _notes = "";
|
|
private bool _isCompleted;
|
|
private int _index;
|
|
|
|
public int Id { get; set; }
|
|
|
|
public int Index
|
|
{
|
|
get => _index;
|
|
set { if (_index != value) { _index = value; OnPropertyChanged(nameof(Index)); } }
|
|
}
|
|
|
|
public string Title
|
|
{
|
|
get => _title;
|
|
set { if (_title != value) { _title = value; OnPropertyChanged(nameof(Title)); } }
|
|
}
|
|
|
|
public string Notes
|
|
{
|
|
get => _notes;
|
|
set { if (_notes != value) { _notes = value; OnPropertyChanged(nameof(Notes)); } }
|
|
}
|
|
|
|
public bool IsCompleted
|
|
{
|
|
get => _isCompleted;
|
|
set { if (_isCompleted != value) { _isCompleted = value; OnPropertyChanged(nameof(IsCompleted)); } }
|
|
}
|
|
|
|
public DateTime CreatedAt { get; set; } = DateTime.Now;
|
|
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
protected void OnPropertyChanged(string propertyName)
|
|
{
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
}
|