internal void RemoveEmptyParagraphs() { var startParagraph = StartText.GetParent <Paragraph>(); if (startParagraph?.Parent != null && !startParagraph.HasText() && CanDeleteParagraph(startParagraph)) { startParagraph.Remove(); } var endParagraph = EndText.GetParent <Paragraph>(); if (endParagraph?.Parent != null && !endParagraph.HasText() && CanDeleteParagraph(endParagraph)) { endParagraph.Remove(); } var tb = this as TextBlock; if (tb?.FirstInsertionPointParagraph.Parent != null) { tb.FirstInsertionPointParagraph.Remove(); } }
internal void RemoveEmptyParagraphs() { var startParagraph = StartText.GetParent <Paragraph>(); if (startParagraph?.Parent != null && !startParagraph.HasText() && CanDeleteParagraph(startParagraph)) { startParagraph.Remove(); } var endParagraph = EndText.GetParent <Paragraph>(); if (endParagraph?.Parent != null && !endParagraph.HasText() && CanDeleteParagraph(endParagraph)) { endParagraph.Remove(); } }