private void DeleteKey_Click(object sender, RoutedEventArgs e) { if (point.Previous != null) { graph.SelectedPoint = point.Previous.Value; } else if (point.Next != null) { graph.SelectedPoint = point.Next.Value; } graph.SelectedCurve.RemovePoint(point); graph.Paint(); }