/// <summary> /// Called when the user presses clear highlight button /// </summary> /// <param name="arg"></param> void OnClearHighlightButtonClick(NEventArgs arg) { NList <NNode> shapes = m_DrawingView.Drawing.GetDescendants(NShape.NShapeSchema); for (int i = 0; i < shapes.Count; i++) { NShape shape = (NShape)shapes[i]; NRangeTextElement rootTextElement = (NRangeTextElement)shape.GetTextBlockContentNoCreate(); if (rootTextElement == null) { continue; } rootTextElement.VisitRanges(delegate(NRangeTextElement range) { NInline inline = range as NInline; if (inline != null) { inline.ClearLocalValue(NInline.HighlightFillProperty); } }); } }