protected override void Write([NotNull] XamlRenderer renderer, ParagraphBlock obj) { if (!renderer.IsFirstInContainer) { renderer.EnsureLine(); } renderer.WriteLine("<Paragraph>"); renderer.WriteLeafInline(obj); renderer.EnsureLine(); renderer.WriteLine("</Paragraph>"); }
protected override void Write([NotNull] XamlRenderer renderer, [NotNull] HeadingBlock obj) { renderer.Write("<Paragraph"); if (obj.Level > 0 && obj.Level <= 6) { // Apply style depending on heading level renderer.Write($" Style=\"{{StaticResource {{x:Static markdig:Styles.Heading{obj.Level}StyleKey}}}}\""); } renderer.WriteLine(">"); renderer.WriteLeafInline(obj); renderer.EnsureLine(); renderer.WriteLine("</Paragraph>"); }
protected override void Write(XamlRenderer renderer, ParagraphBlock obj) { if (renderer == null) { throw new ArgumentNullException(nameof(renderer)); } if (obj == null) { throw new ArgumentNullException(nameof(obj)); } if (!renderer.IsFirstInContainer) { renderer.EnsureLine(); } renderer.WriteLine("<Paragraph>"); renderer.WriteLeafInline(obj); renderer.EnsureLine(); renderer.WriteLine("</Paragraph>"); }
protected override void Write(XamlRenderer renderer, HeadingBlock obj) { if (renderer == null) { throw new ArgumentNullException(nameof(renderer)); } if (obj == null) { throw new ArgumentNullException(nameof(obj)); } renderer.Write("<Paragraph"); if (obj.Level > 0 && obj.Level <= 6) { // Apply style depending on heading level renderer.Write($" Style=\"{{StaticResource {{x:Static markdig:Styles.Heading{obj.Level}StyleKey}}}}\""); } renderer.WriteLine(">"); renderer.WriteLeafInline(obj); renderer.EnsureLine(); renderer.WriteLine("</Paragraph>"); }