using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace DodoSSH.Client.Android.Views;

/// <summary>
/// A state this head has not built, saying so in its own words.
/// </summary>
/// <remarks>
/// Styled properties rather than a view model: there is no state behind this control, and giving it one
/// would make it look like a screen that might one day have data.
/// </remarks>
internal sealed partial class PendingScreen : UserControl
{
    public static readonly StyledProperty<string> HeadingProperty =
        AvaloniaProperty.Register<PendingScreen, string>(nameof(Heading), string.Empty);

    public static readonly StyledProperty<string> DetailProperty =
        AvaloniaProperty.Register<PendingScreen, string>(nameof(Detail), string.Empty);

    public PendingScreen()
    {
        AvaloniaXamlLoader.Load(this);

        // Its own data context, so the two properties can be bound in XAML like anything else. Safe here
        // and only here: this control deliberately shows nothing from the shell, so there is no inherited
        // context worth keeping.
        DataContext = this;
    }

    public string Heading
    {
        get => GetValue(HeadingProperty);
        set => SetValue(HeadingProperty, value);
    }

    public string Detail
    {
        get => GetValue(DetailProperty);
        set => SetValue(DetailProperty, value);
    }
}
