Public Access
Merge branch 'claude/sleepy-chebyshev-cda68d'
This commit is contained in:
@@ -142,6 +142,17 @@ internal sealed partial class MainWindowViewModel : ObservableObject, IAsyncDisp
|
||||
/// <summary>Where the embedded browser should navigate.</summary>
|
||||
internal Uri TerminalPageUrl => workspace.PageUrl;
|
||||
|
||||
/// <summary>
|
||||
/// Raised when a terminal session opens, so the view can hand the terminal the keyboard.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Forwarded from <see cref="VaultViewModel.SessionOpened"/> rather than exposed there directly,
|
||||
/// because <see cref="Vault"/> is replaced on every unlock and the view would have to re-subscribe
|
||||
/// each time. This shell is the window's data context for the life of the process, so one
|
||||
/// subscription is enough.
|
||||
/// </remarks>
|
||||
internal event EventHandler? TerminalSessionOpened;
|
||||
|
||||
internal bool IsStarting => State == ShellState.Starting;
|
||||
|
||||
internal bool IsNeedingServer => State == ShellState.NeedsServer;
|
||||
@@ -469,6 +480,26 @@ internal sealed partial class MainWindowViewModel : ObservableObject, IAsyncDisp
|
||||
return exception.Message;
|
||||
}
|
||||
|
||||
/// <remarks>
|
||||
/// One place for the subscription, so unlocking, locking and disposing all route through it rather
|
||||
/// than each remembering to detach.
|
||||
/// </remarks>
|
||||
partial void OnVaultChanged(VaultViewModel? oldValue, VaultViewModel? newValue)
|
||||
{
|
||||
if (oldValue is not null)
|
||||
{
|
||||
oldValue.SessionOpened -= OnVaultSessionOpened;
|
||||
}
|
||||
|
||||
if (newValue is not null)
|
||||
{
|
||||
newValue.SessionOpened += OnVaultSessionOpened;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnVaultSessionOpened(object? sender, EventArgs e) =>
|
||||
TerminalSessionOpened?.Invoke(this, e);
|
||||
|
||||
partial void OnStateChanged(ShellState value)
|
||||
{
|
||||
OnPropertyChanged(nameof(IsStarting));
|
||||
|
||||
Reference in New Issue
Block a user