using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PhilExample.Interfaces;
using PhilExample.VMs;
using PhilExampleCrawler.Common.Interfaces;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace PhilExample.UI.Pages
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class SelectRadiusPage : CallbackPage<ICategory>
    {
        readonly SelectRadiusVM _vm = new SelectRadiusVM();
        public SelectRadiusPage()
        {
            InitializeComponent();
            BindingContext = _vm;

            _vm.OnPopped +=
                (_, cat) => SetPopupResult(cat);
        }

        protected override async void OnAppearing()
        {
            base.OnAppearing();
            await _vm.OnAppearingAsync();
        }
    }
}