Files
ReminderOrganizer/TaskWindow.xaml.cs
Michi 3e0b00f11c Professional redesign: native window, settings, calmer UI
- WindowChrome: resizable, snap layouts, native shadow, DWM rounded
  corners; size/position remembered; fade-in after load (no theme flash)
- Menu bar replaced by a settings window (theme system/light/dark,
  language, sound, autostart, categories, data, shortcuts, about)
- Shared styles in Themes/Controls.xaml; neutral palette with one accent
  applied to Application.Resources (context menus/tooltips themed)
- Rows: To-Do style check left, title + details, relative date right,
  actions on hover, visible selection (Enter edits, Del deletes)
- No glow/scale effects; subtle animations (dialogs, snackbar, chevrons)
- Checking a recurring task moves it to the next date (with undo)
- Themed combo box, date picker, check box; neutral dialog headers
- New flat app icon (tools/make_icon.py)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 18:10:45 +01:00

52 lines
1.7 KiB
C#

#nullable enable
using System.Windows;
using System.Windows.Input;
using ReminderOrganizer.Core;
using ReminderOrganizer.Models;
using ReminderOrganizer.Services;
using ReminderOrganizer.ViewModels;
namespace ReminderOrganizer
{
public partial class TaskWindow : Window
{
private readonly TaskViewModel _viewModel;
public ReminderTask TaskResult => _viewModel.TaskResult;
/// <param name="defaultCategory">Opens a new entry as anniversary of this category (null = appointment).</param>
public TaskWindow(ReminderTask? existingTask, bool darkMode,
System.Collections.Generic.IEnumerable<Category> categories, string? defaultCategory = null)
{
InitializeComponent();
DialogAnimation.Attach(this);
Theme.Apply(Resources, darkMode);
var localizationService = (ILocalizationService)ServiceLocator.Services.GetService(typeof(ILocalizationService))!;
_viewModel = new TaskViewModel(localizationService, existingTask, defaultCategory, categories);
_viewModel.RequestClose += OnRequestClose;
DataContext = _viewModel;
Loaded += (_, _) =>
{
NameBox.Focus();
NameBox.SelectAll();
};
}
private void OnRequestClose(object? sender, bool result)
{
DialogResult = result;
Close();
}
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed && e.OriginalSource is not System.Windows.Controls.TextBox)
{
DragMove();
}
}
}
}