using Windows.UI.Xaml.Controls;

namespace FoxTube.Pages
{
    public sealed partial class Home1 : Page
    {
        public Home1()
        {
            InitializeComponent();
        }

        public async void Initialize()
        {
            SecretsVault.HttpClient.DefaultRequestHeaders.Referrer = "https://youtube.com/".ToUri();
            string response = await SecretsVault.Service.HttpClient.GetStringAsync(adress.Text);
            code.Text = response;
            //view.NavigateToString(response);
        }

        private void Adress_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            Initialize();
        }
    }
}
