2
0

Restructured sample pages folder

This commit is contained in:
2026-01-11 10:37:01 -05:00
parent 518434bc4e
commit f87ea17a6f
8 changed files with 301 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
// NewTodoPage - Create a new todo item
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();
}
}