using CollaborativePlatformMain.DFEntity.MessageSubUtil;
using CollaborativePlatformMain.Form.UserControlForm;
using System;
using System.Collections.Generic;
using System.ComponentModel;
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.Shapes;

namespace CollaborativePlatformMain.Form.MessageSubPage.Project
{
    /// <summary>
    /// TempPage.xaml 的交互逻辑
    /// </summary>
    public partial class TempPage : Page
    {
        public List<NativeDataInfo> ArchUserDatas = new List<NativeDataInfo>();
        public List<NativeDataInfo> StruUserDatas = new List<NativeDataInfo>();
        public List<NativeDataInfo> WaterUserDatas = new List<NativeDataInfo>();
        public List<NativeDataInfo> WarmUserDatas = new List<NativeDataInfo>();
        public List<NativeDataInfo> EleUserDatas = new List<NativeDataInfo>();



        public TempPage()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 窗体初始化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            ArchUserDatas = new List<NativeDataInfo>();
            StruUserDatas = new List<NativeDataInfo>();
            WaterUserDatas = new List<NativeDataInfo>();
            WarmUserDatas = new List<NativeDataInfo>();
            EleUserDatas = new List<NativeDataInfo>();

            ArchUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计1"));
            ArchUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计2"));
            ArchUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计3"));
            ArchUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计4"));
            ArchUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计5"));

            StruUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计1"));
            StruUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计2"));
            StruUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计3"));
            StruUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计4"));
            StruUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计5"));


            WaterUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计1"));
            WaterUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计2"));
            WaterUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计3"));
            WaterUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计4"));
            WaterUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计5"));

            WarmUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计1"));
            WarmUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计2"));
            WarmUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计3"));
            WarmUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计4"));
            WarmUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计5"));

            EleUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计1"));
            EleUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计2"));
            EleUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计3"));
            EleUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计4"));
            EleUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计5"));

            cb_arch.ItemsSource = ArchUserDatas;
            cb_stru.ItemsSource = StruUserDatas;
            cb_water.ItemsSource = WaterUserDatas;
            cb_warm.ItemsSource = WarmUserDatas;
            cb_ele.ItemsSource = EleUserDatas;
        }

        /// <summary>
        /// 添加专业成员
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bt_add_Click(object sender, RoutedEventArgs e)
        {
            string addValue = tb_add.Text.ToString();
            if (addValue == null || addValue == "") return;

            Label label = new Label();
            label.Content = addValue;
            label.Width = 80;
            //label.Background= new SolidColorBrush((Color)ColorConverter.ConvertFromString("#eee"));

            NativeCombox nativeCombox = new NativeCombox();
            List<NativeDataInfo> nativeDataInfos = new List<NativeDataInfo>();
            nativeDataInfos.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计1"));
            nativeDataInfos.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计2"));
            nativeDataInfos.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计3"));
            nativeDataInfos.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计4"));
            nativeDataInfos.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计5"));
            nativeCombox.ItemsSource = nativeDataInfos;
            nativeCombox.Width = 200;
            nativeCombox.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#eee"));
            nativeCombox.HorizontalAlignment = HorizontalAlignment.Left;


            DockPanel dockPanel = new DockPanel();
            dockPanel.Children.Add(label);
            dockPanel.Children.Add(nativeCombox);
            dockPanel.Margin = new Thickness(0, 5, 0, 0);

            sp_temps.Children.Add(dockPanel);

            tb_add.Text = "";
        }

    }
}
