private void OnMouseUp(object sender, MouseButtonEventArgs e) { ControlCircle viewModel = (ControlCircle)((FrameworkElement)sender).DataContext; viewModel.OnMouseUp(); UpdateSvg(); }
private string GetNewStrokeContent() { StringBuilder ret = new StringBuilder(); ControlCircle firstCircle = Circles.First(); ret.AppendFormat("M{0} {1}", firstCircle.Pos.X, firstCircle.Pos.Y); foreach (ControlCircle circle in Circles.Skip(1)) { ret.AppendFormat(" L{0} {1}", circle.Pos.X, circle.Pos.Y); } return(ret.ToString()); }
private void OnMouseEnter(object sender, MouseEventArgs e) { ControlCircle viewModel = (ControlCircle)((FrameworkElement)sender).DataContext; viewModel.OnMouseEnter(); }
private void OnMouseMove(object sender, MouseEventArgs e) { ControlCircle viewModel = (ControlCircle)((FrameworkElement)sender).DataContext; viewModel.OnMouseMove(e.LeftButton, e.GetPosition(ConstructionCanvas)); }