public void SaveHelper() { if (comments != null) { polyCanvas.Children.Clear(); canvas.Children.Clear(); // probably better way than this... Debug.WriteLine(comments.GetComments().Count); foreach (Comment c in comments.GetComments()) { DrawRectangle(c); } } if (animations != null) { foreach (Animation a in animations.GetAnimations()) { for (int i = 0; i < a.inkStrokesId.Count; i++) { a.inkStrokesId[i] = inkCanvas.InkPresenter.StrokeContainer.GetStrokes()[a.inkStrokesIndex[i]].Id; } // recreate polyline! polyline = new Polyline() { Stroke = new SolidColorBrush(Windows.UI.Colors.ForestGreen), StrokeThickness = 1.5, StrokeDashArray = new DoubleCollection() { 5, 2 }, }; polyline.Points = a.linePoints; polyline.Opacity = togglePath.IsChecked == true ? 0.5 : 0; a.nameText.Opacity = togglePath.IsChecked == true ? 0.5 : 0; a.SetPolyline(polyline); polyCanvas.Children.Add(polyline); addPolylineText(a); } } }