//Color FillColor = Colors.Green; void c_PointerReleased(object sender, PointerRoutedEventArgs e) { if (type == 1) { ep = e.GetCurrentPoint(pc.SelectLayer).Position; dg.DrawLine(sp.X, sp.Y, ep.X, ep.Y, false, Convert.ToInt32(textW.Text), new SolidColorBrush(ForeColor)); } if (type == 2) { ep = e.GetCurrentPoint(pc.SelectLayer).Position; dg.DrawRectangle(sp.X, sp.Y, ep.X, ep.Y, checkBox1.IsChecked == true, Convert.ToInt32(textW.Text), new SolidColorBrush(ForeColor), new SolidColorBrush(ForeColor)); } if (type == 3) { ep = e.GetCurrentPoint(pc.SelectLayer).Position; dg.DrawEllipse(sp.X, sp.Y, ep.X, ep.Y, checkBox1.IsChecked == true, Convert.ToInt32(textW.Text), new SolidColorBrush(ForeColor), new SolidColorBrush(ForeColor)); } if (type == 4) { ep = e.GetCurrentPoint(pc.SelectLayer).Position; TextBox tb = dg.DrawEditText(sp.X, sp.Y, ep.X, ep.Y, "Text", new SolidColorBrush(ForeColor), ForeFont); tb.LostFocus += new RoutedEventHandler(tb_LostFocus); } if (type == 5) { begin = false; c.PointerMoved -= new PointerEventHandler(c_PointerMoved); } c.PointerPressed -= new PointerEventHandler(c_PointerPressed); c.PointerReleased -= new PointerEventHandler(c_PointerReleased); e.Handled = true; }