Beispiel #1
0
        /// <summary>
        /// 编辑回调
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ContextMenuClick_Edit(object sender, RoutedEventArgs e)
        {
            if (m_catalog.ActiveMapDoc.ActiveLayerIndex < 0)
            {
                MessageBox.Show("请激活该编辑的图层", "提示", MessageBoxButton.OK);
                return;
            }
            TabItem item = tabControl1.SelectedItem as TabItem;

            if (item != null)
            {
                DataGrid datagrid = item.Content as DataGrid;
                if (datagrid != null)
                {
                    m_lastSelDataGrid = datagrid;
                    int tabIndex = Convert.ToInt32(((System.Windows.FrameworkElement)(((System.Windows.Controls.ContentControl)(tabControl1.SelectedItem)).Content)).Name.ToString().Split('_')[1]);
                    if (tabIndex >= 0 && tabIndex < _lastSelRlt.AttDS[0].attTables.Length)
                    {
                        m_lastSelItem = datagrid.SelectedItem as BindClass;
                        if (MapDocEditorObj == null)
                        {
                            MapDocEditorObj = new MapDocEditor()
                            {
                                ActiveMapDoc = m_catalog.ActiveMapDoc, GraphicsLayer = this.GraphicsLayer
                            }
                        }
                        ;
                        MapDocEditorObj.SetAttStruct(_lastSelRlt.AttDS[0].attTables[tabIndex].Columns, datagrid.SelectedItem as BindClass, this);
                    }
                }
            }
        }
 public ToolbarByMapDoc()
 {
     InitializeComponent();
     m_mapDocDataViewer = new MapDocDataViewer()
     {
         IsPopup = true, MapDocEditorObj = MapDocEditor
     };
     m_conditionInput = new ConditionInput(m_mapDocDataViewer)
     {
         IsPopup = true
     };
     this.BorderThickness = new Thickness(0);
     MapDocEditor         = new MapDocEditor(m_catalog)
     {
         IsPopup = true
     };
 }