namespace inutralia.Views
{
    using System;
    using System.IO;
    using System.Reflection;
    using Xamarin.Forms;

    public partial class RegisterConditionsView : ContentPage
    {
        public RegisterConditionsView()
        {
            InitializeComponent();

            var htmlSource = new HtmlWebViewSource();

            var assembly = typeof(App).GetTypeInfo().Assembly;
            Stream stream = assembly.GetManifestResourceStream("inutralia.LegalConditions.html");
            using (var reader = new StreamReader(stream))
            {
                htmlSource.Html = reader.ReadToEnd();
            }

            ConditionsWebView.Source = htmlSource;
        }

        async void OnBackButtonClicked(object sender, EventArgs e)
        {
            await Navigation.PopModalAsync();
        }
    }
}