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>
30 lines
696 B
C#
30 lines
696 B
C#
using System;
|
|
using Microsoft.Maui.Controls;
|
|
using Microsoft.Maui.Graphics;
|
|
|
|
namespace TodoApp;
|
|
|
|
public partial class NewTodoPage : ContentPage
|
|
{
|
|
private readonly TodoService _service = TodoService.Instance;
|
|
|
|
public NewTodoPage()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private async void OnSaveClicked(object? sender, EventArgs e)
|
|
{
|
|
var title = TitleEntry.Text?.Trim();
|
|
if (string.IsNullOrEmpty(title))
|
|
{
|
|
TitleEntry.Placeholder = "Title is required!";
|
|
TitleEntry.PlaceholderColor = Colors.Red;
|
|
return;
|
|
}
|
|
|
|
_service.AddTodo(title, NotesEditor.Text ?? "");
|
|
await Navigation.PopAsync();
|
|
}
|
|
}
|