コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        private void _DrawShape()
        {
            List <Point> points = _CalculatePoints();

            DrawingVisual visual = new DrawingVisual();

            using (DrawingContext dc = visual.RenderOpen())
            {
                if (points.Count > 0)
                {
                    Point start = points[0];
                    foreach (Point p in points)
                    {
                        dc.DrawLine(_pen, start, p);
                        start = p;
                    }
                }

                DrawingSpace.DeleteVisual(_visual);
                _visual = visual;
                DrawingSpace.AddVisual(_visual);
            }
        }
コード例 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Button2_Unchecked(object sender, RoutedEventArgs e)
 {
     DrawingSpace.DeleteVisual(_grid);
 }
コード例 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Button1_Unchecked(object sender, RoutedEventArgs e)
 {
     _dispatcherTimer.Stop();
     NoSignalLabel.Visibility = Visibility.Visible;
     DrawingSpace.DeleteVisual(_visual);
 }