feat(ui): centralize retained window lifecycle

This commit is contained in:
Erik 2026-07-10 21:31:18 +02:00
parent 4bb37e302e
commit 6e9e10367f
12 changed files with 778 additions and 57 deletions

View file

@ -0,0 +1,24 @@
using System;
namespace AcDream.App.UI;
/// <summary>
/// Lifecycle contract for a controller attached to a retained retail window.
/// Implementations own panel-specific subscriptions and reactions; the window
/// manager owns visibility, focus, capture, geometry, and teardown ordering.
/// </summary>
public interface IRetainedPanelController : IDisposable
{
/// <summary>Called once for each hidden-to-shown transition.</summary>
void OnShown();
/// <summary>Called once for each shown-to-hidden transition.</summary>
void OnHidden();
/// <summary>
/// Called when keyboard focus enters, leaves, or moves within this window.
/// <paramref name="focusedDescendant"/> is null when focus left the window.
/// Controllers that do not react to focus may use this default no-op.
/// </summary>
void OnDescendantFocusChanged(UiElement? focusedDescendant) { }
}