//绘制矩形 private void btn_Rectangle_Click(object sender, RoutedEventArgs e) { DrawRectangle rectangle = new DrawRectangle(this.MyMap); this.MyMap.Action = rectangle; rectangle.DrawCompleted += new EventHandler<DrawEventArgs>(rectangle_DrawCompleted); }
private void BtnRectangle_Click(object sender, RoutedEventArgs e) { DrawRectangle drawRectangle = new DrawRectangle(MyMap) { StrokeThickness = 5, Stroke = new SolidColorBrush(Colors.Green), Fill = new SolidColorBrush(Colors.Orange) }; drawRectangle.DrawCompleted += new EventHandler<DrawEventArgs>(drawRectangle_DrawComplete); MyMap.Action = drawRectangle; }
//绘制矩形,并且设置绘制时的样式 private void btn_Rectangle_Click(object sender, RoutedEventArgs e) { DrawRectangle rectangle = new DrawRectangle(this.MyMap) { Fill = new SolidColorBrush(Colors.Blue) }; this.MyMap.Action = rectangle; rectangle.DrawCompleted += new EventHandler<DrawEventArgs>(rectangle_DrawCompleted); }