using FLY.Thick.FilmCasting.UI.DbViewer.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Unity;

namespace FLY.Thick.FilmCasting.UI.DbViewer
{
    public class UnityExt
    {

        public static UnityContainer Container;
        static UnityExt()
        {
            Init();
        }
        static void Init()
        {
            Container = new UnityContainer();

            Container.RegisterFactory<DbViewerModel>((unity) =>
            {
                var dbViewer = new DbViewerModel();
                dbViewer.Init();
                return dbViewer;
            }, new Unity.Lifetime.ContainerControlledLifetimeManager());

        }

    }
}
