private void symbolBtn_Click(object sender, RoutedEventArgs e) { // 先关闭所有的工具条 Canvas userControlsLayoutCsy = (Canvas)w.FindName("userControlsLayoutCsy"); List <StackPanel> tools = ArcGISApp1.Utils.GetChildNode.GetChildObjects <StackPanel>(userControlsLayoutCsy); for (int i = 0; i < tools.Count(); i++) { tools[i].Visibility = Visibility.Collapsed; } // 符号渲染窗口 if (layer.FeatureTable.GeometryType == Esri.ArcGISRuntime.Geometry.GeometryType.Point) { featureStyle = 1; var window = new Window(); Controls.SymbolFormCSY.PointCsy pointForm = new Controls.SymbolFormCSY.PointCsy(); window.Content = pointForm; window.SizeToContent = SizeToContent.WidthAndHeight; window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Title = "点符号渲染工具"; window.Closed += windowClosed_Point; window.Show(); } else if (layer.FeatureTable.GeometryType == Esri.ArcGISRuntime.Geometry.GeometryType.Polyline) { featureStyle = 2; var window = new Window(); Controls.SymbolFormCSY.LineCsy lineForm = new Controls.SymbolFormCSY.LineCsy(); window.Content = lineForm; window.SizeToContent = SizeToContent.WidthAndHeight; window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Title = "线符号渲染工具"; window.Closed += windowClosed_Line; window.Show(); } else if (layer.FeatureTable.GeometryType == Esri.ArcGISRuntime.Geometry.GeometryType.Polygon) { featureStyle = 3; var window = new Window(); Controls.SymbolFormCSY.FillCsy fillForm = new Controls.SymbolFormCSY.FillCsy(); window.Content = fillForm; window.SizeToContent = SizeToContent.WidthAndHeight; window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Title = "面符号渲染工具"; window.Closed += windowClosed_Polygon; window.Show(); } }
// 符号渲染 private void ChangeSymbol_Layers_CheckBox(object sender, RoutedEventArgs e) { MenuItem menuItem = sender as MenuItem; // 获取父控件 ContextMenu cm = menuItem.Parent as ContextMenu; //cm.Visibility = Visibility.Hidden; int index = int.Parse(cm.Name.Substring(16)); currentMyMapViewLayer = (FeatureLayer)myMapView.Map.OperationalLayers[index]; // 需要检查是否是矢量图层 if (currentMyMapViewLayer.FeatureTable.GeometryType == Esri.ArcGISRuntime.Geometry.GeometryType.Point) { var window = new Window(); Controls.SymbolFormCSY.PointCsy pointForm = new Controls.SymbolFormCSY.PointCsy(); window.Content = pointForm; window.SizeToContent = SizeToContent.WidthAndHeight; window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Title = "点符号渲染工具"; window.Closed += windowClosed_Point; window.Show(); } else if (currentMyMapViewLayer.FeatureTable.GeometryType == Esri.ArcGISRuntime.Geometry.GeometryType.Polyline) { var window = new Window(); Controls.SymbolFormCSY.LineCsy lineForm = new Controls.SymbolFormCSY.LineCsy(); window.Content = lineForm; window.SizeToContent = SizeToContent.WidthAndHeight; window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Title = "线符号渲染工具"; window.Closed += windowClosed_Line; window.Show(); } else if (currentMyMapViewLayer.FeatureTable.GeometryType == Esri.ArcGISRuntime.Geometry.GeometryType.Polygon) { var window = new Window(); Controls.SymbolFormCSY.FillCsy fillForm = new Controls.SymbolFormCSY.FillCsy(); window.Content = fillForm; window.SizeToContent = SizeToContent.WidthAndHeight; window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Title = "面符号渲染工具"; window.Closed += windowClosed_Polygon; window.Show(); } }
private void StyleButton_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (StyleButton.SelectedIndex == 0) { var window = new Window(); Controls.SymbolFormCSY.PointCsy fillForm = new Controls.SymbolFormCSY.PointCsy(); window.Content = fillForm; window.SizeToContent = SizeToContent.WidthAndHeight; window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Title = "点符号渲染工具"; //window.Closed += windowClosed_Polygon; window.Show(); } else if (StyleButton.SelectedIndex == 1) { var window = new Window(); Controls.SymbolFormCSY.LineCsy fillForm = new Controls.SymbolFormCSY.LineCsy(); window.Content = fillForm; window.SizeToContent = SizeToContent.WidthAndHeight; window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Title = "线符号渲染工具"; //window.Closed += windowClosed_Polygon; window.Show(); } else if (StyleButton.SelectedIndex == 2) { var window = new Window(); Controls.SymbolFormCSY.FillCsy fillForm = new Controls.SymbolFormCSY.FillCsy(); window.Content = fillForm; window.SizeToContent = SizeToContent.WidthAndHeight; window.WindowStartupLocation = WindowStartupLocation.CenterScreen; window.Title = "面符号渲染工具"; //window.Closed += windowClosed_Polygon; window.Show(); } }