using Avalonia.Controls; using Avalonia.Input; using DodoSSH.Client.Shell.ViewModels; namespace DodoSSH.Client.App.Views; /// Vaults, restyled into the settings page idiom — see the remark at the top of the markup. internal sealed partial class SettingsVaultsPage : UserControl { public SettingsVaultsPage() => InitializeComponent(); private MainWindowViewModel? Shell => DataContext as MainWindowViewModel; /// /// Only a press on the wash itself, the same test QuickConnect.OnBackdropPressed makes: a press /// inside the card bubbles through here too, with its source the control that was actually hit rather /// than the backdrop, so closing on those would make the panel impossible to click into. /// private void OnBackdropPressed(object? sender, PointerPressedEventArgs e) { if (!ReferenceEquals(e.Source, MembersBackdrop) || Shell is not { } shell) { return; } shell.Vaults.CloseMembersPanelCommand.Execute(null); e.Handled = true; } }