using Misc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Unity;

namespace FLY.Thick.Base.UI
{
    /// <summary>
    /// PgCustomSections.xaml 的交互逻辑
    /// </summary>
    public partial class PgCustomSections : Page
    {
        ParamDictionary paramDictionary;
        IUnityContainer container;
        public PgCustomSections()
        {
            InitializeComponent();
        }
        [InjectionMethod]
        public void Init(IUnityContainer container, ParamDictionary paramDictionary ) 
        {
            this.paramDictionary = paramDictionary;
            this.container = container;

            //找到 customSections.ui 容器
            if (!container.IsRegistered<IUnityContainer>("customSections.ui"))
                return;

            var section_container = container.Resolve<IUnityContainer>("customSections.ui");
            var ucs = section_container.ResolveAll<UserControl>();
            foreach (var uc in ucs) 
            {
                spSections.Children.Add(uc);
            }
        }
    }
}
