private DateTime m_timeLastLeftButtonUp = DateTime.Now;//鼠标左键弹起的时间,判断双击用 /// <summary> /// 鼠标在DataGrid弹起事件回调 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DataGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { DateTime b = DateTime.Now; long c = CommFun.TimeDiff(b, m_timeLastLeftButtonUp); m_timeLastLeftButtonUp = b; if (c < 280) {//双击事件 if (m_graphicsLayer != null && m_graphics != null) { m_graphicsLayer.RemoveGraphics(m_graphics); m_graphics = null; } DataGrid grid = sender as DataGrid; if (grid != null && grid.SelectedItem is BindClass && grid.Tag is TmpInfo && m_graphicsLayer != null) { CLayerGetByID getGeo = new CLayerGetByID(); getGeo.GdbIndex = (grid.Tag as TmpInfo).GDBIndex; getGeo.LayerIndex = (grid.Tag as TmpInfo).LayerIndex; getGeo.FeatureID = Convert.ToInt32((grid.SelectedItem as BindClass).key0); activeLayer.GetGeomByFID(getGeo, new UploadStringCompletedEventHandler(FlashFeature)); } } }