using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using XfpDemo1.AppStart;
using NavigationPage = AvvmTools.NavigationPage;

namespace XfpDemo1.Views.Navigation
{
    public class MyNavigationPage : NavigationPage
    {
        public MyNavigationPage(Page page) : base(page)
        {
            // Add custom navigation bar design here
        }

        public override async Task RefreshPage()
        {
            var host = HostIoc.Get<Host>();
            var theme = host.Theme.NavigationPage;

            this.BackgroundColor = theme.BackgroundColor;
            this.BarBackgroundColor = theme.BarBackgroundColor;
            this.BarTextColor = theme.BarTextColor;
        }

        protected override async void OnAppearing()
        {
            base.OnAppearing();
            await this.RefreshPage();
        }
    }
}
