using Gready_Poang.CommandClasses;

namespace Gready_Poang.Views;

public partial class RoundStartingView : ContentPage
{


    public RoundStartingView(RoundStartingViewModelCommands viewModel)
    {
        InitializeComponent();
        ViewModel = viewModel;
    }
    public RoundStartingViewModelCommands ViewModel { get; set; }

    public int GameRoundId { get; set; }

    protected override void OnAppearing()
    {
        base.OnAppearing();
        BindingContext = ViewModel;
        ViewModel.Get();
        ViewModel.GetParticipants();
    }

    protected override void OnSizeAllocated(double width, double height)
    {
        base.OnSizeAllocated(width, height);

        if (ResponsiveStack == null || width <= 0)
            return;

        var state = width < 500 ? "Narrow" : "Wide";
        VisualStateManager.GoToState(ResponsiveStack, state);
        System.Diagnostics.Debug.WriteLine($"width={width} ResponsiveStack={state} ");
    }


}