feat(ui): centralize retained window lifecycle
This commit is contained in:
parent
4bb37e302e
commit
6e9e10367f
12 changed files with 778 additions and 57 deletions
|
|
@ -120,7 +120,25 @@ public abstract class UiElement
|
|||
}
|
||||
|
||||
// ── State flags ─────────────────────────────────────────────────────
|
||||
public bool Visible { get; set; } = true;
|
||||
private bool _visible = true;
|
||||
public bool Visible
|
||||
{
|
||||
get => _visible;
|
||||
set
|
||||
{
|
||||
if (_visible == value) return;
|
||||
|
||||
// A top-level visibility transition is also an ownership boundary:
|
||||
// focus/capture/modal state must be released before the subtree becomes
|
||||
// unreachable to input. UiRoot filters these notifications through the
|
||||
// registered-window manager, while ordinary child visibility changes
|
||||
// remain cheap and behavior-neutral.
|
||||
UiRoot? root = FindRoot();
|
||||
root?.OnElementVisibilityChanging(this, value);
|
||||
_visible = value;
|
||||
root?.OnElementVisibilityChanged(this, value);
|
||||
}
|
||||
}
|
||||
private bool _enabled = true;
|
||||
public bool Enabled
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue