/// <summary> /// 编辑回调 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ContextMenuClick_Edit(object sender, RoutedEventArgs e) { if (m_catalog.ActiveLayerObj.ActiveLayerIndex < 0 || m_catalog.ActiveLayerObj.ActiveGdbIndex < 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; m_lastSelItem = datagrid.SelectedItem as BindClass; if (LayerEditorObj == null) { LayerEditorObj = new LayerEditor() { ActiveLayerObj = m_catalog.ActiveLayerObj, GraphicsLayer = this.GraphicsLayer } } ; if (datagrid.Tag is TmpInfo) { int gdbIndex = (datagrid.Tag as TmpInfo).GDBIndex; int layerIndex = (datagrid.Tag as TmpInfo).LayerIndex; LayerEditorObj.ActiveLayerObj = m_catalog.ActiveLayerObj; LayerEditorObj.GraphicsLayer = GraphicsLayer; LayerEditorObj.SetAttStruct(_lastSelRlt.AttDS[gdbIndex].attTables[layerIndex].Columns, datagrid.SelectedItem as BindClass, this); } } } }
public ToolbarByLayer() { InitializeComponent(); m_layerDataViewer = new LayerDataViewer() { IsPopup = true, LayerEditorObj = LayerEditor }; m_conditionInput = new LayerConditionInput(m_layerDataViewer) { IsPopup = true }; LayerEditor = new LayerEditor(); }