using System;
using System.Collections.Generic;
using System.Windows.Controls;
using Caliburn.Micro;
using Caliburn.PanoramaPivot.ViewModels;

namespace CaliburnMicro
{
    public class Bootstrapper : PhoneBootstrapper
    {
        public  PhoneContainer container { get; set; }

        protected override void Configure()
        {
            container = new PhoneContainer(RootFrame);

            container.RegisterPhoneServices();
            container.PerRequest<MainPageViewModel>();

            container.PerRequest<PivotViewModel>();
            container.PerRequest<PivotItem1ViewModel>();
            container.PerRequest<PivotItem2ViewModel>();

            AddCustomConventions();
        }

        static void AddCustomConventions()
        {
        }

        protected override object GetInstance(Type service, string key)
        {
            return container.GetInstance(service, key);
        }

        protected override IEnumerable<object> GetAllInstances(Type service)
        {
            return container.GetAllInstances(service);
        }

        protected override void BuildUp(object instance)
        {
            container.BuildUp(instance);
        }
    } 
}
