using System.Windows.Input; using Avalonia; using Avalonia.Controls; namespace DodoSSH.Client.App.Views; /// /// The v5b session shell's host header: the address, and a ghost button that crosses to the other surface. /// See the remark at the top of SessionHeader.axaml. /// internal sealed partial class SessionHeader : UserControl { /// What the cross-surface ghost button says — "Open SFTP" or "Open terminal". internal static readonly StyledProperty OpenLabelProperty = AvaloniaProperty.Register(nameof(OpenLabel)); /// What the cross-surface ghost button runs. /// /// The terminal usage binds SelectFilesHostCommand with the selected tab as its parameter; the /// SFTP usage binds OpenTerminalForFilesHostCommand, which needs none — see the remark on both in /// MainWindowViewModel for why the two directions are not symmetrical. /// internal static readonly StyledProperty OpenCommandProperty = AvaloniaProperty.Register(nameof(OpenCommand)); internal static readonly StyledProperty OpenCommandParameterProperty = AvaloniaProperty.Register(nameof(OpenCommandParameter)); /// What the header says instead of an address, while no session/host context is active. internal static readonly StyledProperty EmptyTextProperty = AvaloniaProperty.Register(nameof(EmptyText)); public SessionHeader() => InitializeComponent(); internal string? OpenLabel { get => GetValue(OpenLabelProperty); set => SetValue(OpenLabelProperty, value); } internal ICommand? OpenCommand { get => GetValue(OpenCommandProperty); set => SetValue(OpenCommandProperty, value); } internal object? OpenCommandParameter { get => GetValue(OpenCommandParameterProperty); set => SetValue(OpenCommandParameterProperty, value); } internal string? EmptyText { get => GetValue(EmptyTextProperty); set => SetValue(EmptyTextProperty, value); } }