public void invalidate() { sidebar.Strokes.Clear(); double y = 20; double x = 20; foreach (HeadingItem heading in headings) { Rect firstText = heading.text[0].Strokes.GetBounds(); heading.finalBounds = firstText; double currentY = y; foreach (ContextNode word in heading.text) { StrokeCollection strokes = word.Strokes.Clone(); InkUtils.transposeStrokes(null, strokes, x - firstText.X, currentY - firstText.Y); sidebar.Strokes.Add(strokes); Rect finalBounds = strokes.GetBounds(); if (y < finalBounds.Y + finalBounds.Height) { y = finalBounds.Y + finalBounds.Height; } heading.finalBounds.Union(finalBounds); } y += 20; } sidebar.InvalidateVisual(); }