/// <summary>
        /// 为一个表格动态添加列以及内容;
        /// 表内所有的内容都是在运行时添加的,而不是预先定义好的;
        /// </summary>
        private void InitDynamicClassToDataGrid()
        {
            // ________________________________________________________________________________以下是通过简单的生成
            // 动态添加内容,i表示有多少行,目前的处理就是添加i行相同的内容;
            for (int i = 0; i <= 5; i++)
            {
                dynamic model = new DyDataDridModel();

                // 向单元格内动态添加属性及其;
                // 参数1:动态类型的类型名;
                // 参数2:动态类型的实例;
                // 参数3:列名称;
                model.AddProperty("property2", new GridCell()
                {
                    name = "显示内容1"
                }, "列2");
                model.AddProperty("property0", new GridCell()
                {
                    name = "显示内容2"
                }, "列0");
                model.AddProperty("property1", new GridCell()
                {
                    name = "显示内容3"
                }, "列1");

                list.Add(model);
            }
            // 此处将所有的列信息添加到DataGrid当中;
            for (int i = 0; i <= 2; i++)
            {
                DataGridTextColumn column = new DataGridTextColumn();
                column.Header  = "列" + i;
                column.Binding = new Binding("property" + i + ".name");
                this.MsgDataGrid_AutoGenCol.Columns.Add(column);
            }

            this.MsgDataGrid_AutoGenCol.ItemsSource    = list;
            this.MsgDataGrid_AutoGenCol.BeginningEdit += MsgDataGrid_AutoGenCol_BeginningEdit;



            // ____________________________________________以下是丰富了单元格内容的DataGrid(在单元格内添加下拉框);
            List <string> name_list = new List <string>();

            name_list.Add("Combox_Content1");
            name_list.Add("Combox_Content2");

            Dictionary <int, string> dic_list = new Dictionary <int, string>();

            dic_list.Add(1, "枚举类型1");
            dic_list.Add(2, "枚举类型2");
            dic_list.Add(6, "枚举类型3");

            // 在表格中添加3行内容相同的内容;
            for (int i = 0; i <= 2; i++)
            {
                dynamic model2 = new DyDataDridModel();                    // 创建一个动态模型;

                if (i == 0)
                {
                    // 创建实验数据;
                    model2.AddProperty("p1", name_list, "列1");
                    model2.AddProperty("p2", new GridCellComboBox()
                    {
                        m_AllList    = dic_list,
                        m_CurContent = 6,
                        name         = "枚举类型3"
                    }, "列2");
                    model2.AddProperty("p3", DateTime.Now, "列3");
                    model2.AddProperty("p4", "显示内容6", "列4");
                }
                else if (i == 1)
                {
                    // 创建实验数据;
                    model2.AddProperty("p1", name_list, "列1");
                    model2.AddProperty("p2", new GridCellComboBox()
                    {
                        m_AllList    = dic_list,
                        m_CurContent = 1,
                        name         = "枚举类型1"
                    }, "列2");
                    model2.AddProperty("p3", DateTime.Now, "列3");
                    model2.AddProperty("p4", "显示内容1", "列4");
                }
                else if (i == 2)
                {
                    // 创建实验数据;
                    model2.AddProperty("p1", name_list, "列1");
                    model2.AddProperty("p2", new GridCellComboBox()
                    {
                        m_AllList    = dic_list,
                        m_CurContent = 2,
                        name         = "枚举类型2"
                    }, "列2");
                    model2.AddProperty("p3", DateTime.Now, "列3");
                    model2.AddProperty("p4", "显示内容3", "列4");
                }

                list2.Add(model2);                                         // 三行内容信息集合;

                if (i == 2)
                {
                    //__________________________________________________当数据收集完成之后,使用封装usercontrol的DyDataGrid创建动态表;
                    this.DynamicDataGrid.ColumnModel = model2;
                    this.DynamicDataGrid.DataContext = list2;
                    //_______________________________________________________________________________________________________________

                    // 为表格添加列信息;
                    for (int j = 0; j <= 2; j++)
                    {
                        // 第一种情况,直接显示一个list类型,没有带有任何功能;
                        if (j == 0)
                        {
                            DataGridTemplateColumn column   = new DataGridTemplateColumn();                 // 单元格是一个template;
                            DataTemplate           template = new DataTemplate();                           // 用一个DataTemplate类型填充;
                            ComboBox box = new ComboBox();

                            // 实在没有什么好办法,直接在CS代码当中直接写DataTemplate的XAML代码;
                            string xaml1 =
                                @"<DataTemplate xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
                                                xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
                                                xmlns:model='clr-namespace:WPF.Model'>
                                    <ComboBox ItemsSource='{Binding p" + (j + 1) + @"}' SelectedIndex='0'/>
                                 </DataTemplate>";

                            template = XamlReader.Parse(xaml1) as DataTemplate;

                            column.Header       = "列" + j;                         // 填写列名称;
                            column.CellTemplate = template;                        // 将单元格的显示形式赋值;
                            column.Width        = 230;                             // 设置显示宽度;

                            this.MsgDataGrid_AutoGenColandCellMore.Columns.Add(column);
                        }
                        // 第二种情况,填充一个自定义类型,使得该单元格内可以实现自定义功能;
                        else if (j == 1)
                        {
                            DataGridTemplateColumn column            = new DataGridTemplateColumn();
                            DataTemplate           TextBlockTemplate = new DataTemplate();
                            DataTemplate           ComboBoxTemplate  = new DataTemplate();

                            // 当单元格被编辑的时候;
                            //this.MsgDataGrid_AutoGenColandCellMore.BeginningEdit += MsgDataGrid_AutoGenColandCellMore_BeginningEdit;
                            // 当单元格被双击的时候;
                            //this.MsgDataGrid_AutoGenColandCellMore.MouseDoubleClick += MsgDataGrid_AutoGenColandCellMore_MouseDoubleClick;
                            // 当单元格失去焦点的时候;
                            this.MsgDataGrid_AutoGenColandCellMore.LostFocus += MsgDataGrid_AutoGenColandCellMore_LostFocus;

                            string textblock_xaml =
                                @"<DataTemplate xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
                                                xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
                                                xmlns:model='clr-namespace:WPF.Model'>
                                    <TextBlock Text='{Binding p" + (j + 1) + @".name}'/>
                                 </DataTemplate>";

                            string combobox_xaml =
                                @"<DataTemplate xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
                                                xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
                                                xmlns:model='clr-namespace:WPF.Model'>
                                    <ComboBox ItemsSource='{Binding p" + (j + 1) + @".m_AllListString}' SelectedIndex='0'/>
                                 </DataTemplate>";

                            TextBlockTemplate = XamlReader.Parse(textblock_xaml) as DataTemplate;
                            ComboBoxTemplate  = XamlReader.Parse(combobox_xaml) as DataTemplate;

                            column.Header              = j;                                  // 填写列名称;
                            column.CellTemplate        = TextBlockTemplate;                  // 将单元格的显示形式赋值;
                            column.CellEditingTemplate = ComboBoxTemplate;                   // 将单元格的编辑形式赋值;
                            column.Width = 230;                                              // 设置显示宽度;

                            this.MsgDataGrid_AutoGenColandCellMore.Columns.Add(column);
                        }
                        else if (j == 2)
                        {
                            DataGridTextColumn DGText = new DataGridTextColumn();
                            DGText.Header  = "列" + j;
                            DGText.Binding = new Binding("p" + (j + 1).ToString());
                            this.MsgDataGrid_AutoGenColandCellMore.Columns.Add(DGText);
                        }
                        else if (j == 3)
                        {
                            DataGridTextColumn DGText = new DataGridTextColumn();
                            DGText.Header  = "列" + j;
                            DGText.Binding = new Binding("p" + (j + 1).ToString());
                            this.MsgDataGrid_AutoGenColandCellMore.Columns.Add(DGText);
                        }
                    }
                }
            }


            this.MsgDataGrid_AutoGenColandCellMore.DataContext = list2;
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ReceiveDataLabel2_Drop(object sender, DragEventArgs e)
        {
            DyDataDridModel cell = e.Data.GetData(typeof(DyDataDridModel)) as DyDataDridModel;

            //(sender as Label).Content += ":" + cell.
        }