Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: explicit content in markdowntextblock #178

Draft
wants to merge 1 commit into
base: uno
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
<Border x:Name="RootElement"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" />
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will do. The RootElement is likely manipulated from the code behind, so this is unlikely to fix the issue (this control is not a ContentPresenter).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you are right. I think I found where the rendering actually happens

renderer.Background = Background;
renderer.BorderBrush = BorderBrush;
renderer.BorderThickness = BorderThickness;
renderer.CharacterSpacing = CharacterSpacing;
renderer.FontFamily = FontFamily;
renderer.FontSize = FontSize;
renderer.FontStretch = FontStretch;
renderer.FontStyle = FontStyle;
renderer.FontWeight = FontWeight;
renderer.Foreground = Foreground;
renderer.IsTextSelectionEnabled = IsTextSelectionEnabled;
renderer.Padding = Padding;
renderer.CodeBackground = CodeBackground;
renderer.CodeBorderBrush = CodeBorderBrush;
renderer.CodeBorderThickness = CodeBorderThickness;
renderer.InlineCodeBorderThickness = InlineCodeBorderThickness;
renderer.InlineCodeBackground = InlineCodeBackground;
renderer.InlineCodeBorderBrush = InlineCodeBorderBrush;
renderer.InlineCodePadding = InlineCodePadding;
renderer.InlineCodeFontFamily = InlineCodeFontFamily;
renderer.InlineCodeForeground = InlineCodeForeground;
renderer.CodeForeground = CodeForeground;
renderer.CodeFontFamily = CodeFontFamily;
renderer.CodePadding = CodePadding;
renderer.CodeMargin = CodeMargin;
renderer.EmojiFontFamily = EmojiFontFamily;
renderer.Header1FontSize = Header1FontSize;
renderer.Header1FontWeight = Header1FontWeight;
renderer.Header1Margin = Header1Margin;
renderer.Header1Foreground = Header1Foreground;
renderer.Header2FontSize = Header2FontSize;
renderer.Header2FontWeight = Header2FontWeight;
renderer.Header2Margin = Header2Margin;
renderer.Header2Foreground = Header2Foreground;
renderer.Header3FontSize = Header3FontSize;
renderer.Header3FontWeight = Header3FontWeight;
renderer.Header3Margin = Header3Margin;
renderer.Header3Foreground = Header3Foreground;
renderer.Header4FontSize = Header4FontSize;
renderer.Header4FontWeight = Header4FontWeight;
renderer.Header4Margin = Header4Margin;
renderer.Header4Foreground = Header4Foreground;
renderer.Header5FontSize = Header5FontSize;
renderer.Header5FontWeight = Header5FontWeight;
renderer.Header5Margin = Header5Margin;
renderer.Header5Foreground = Header5Foreground;
renderer.Header6FontSize = Header6FontSize;
renderer.Header6FontWeight = Header6FontWeight;
renderer.Header6Margin = Header6Margin;
renderer.Header6Foreground = Header6Foreground;
renderer.HorizontalRuleBrush = HorizontalRuleBrush;
renderer.HorizontalRuleMargin = HorizontalRuleMargin;
renderer.HorizontalRuleThickness = HorizontalRuleThickness;
renderer.ListMargin = ListMargin;
renderer.ListGutterWidth = ListGutterWidth;
renderer.ListBulletSpacing = ListBulletSpacing;
renderer.ParagraphMargin = ParagraphMargin;
renderer.ParagraphLineHeight = ParagraphLineHeight;
renderer.QuoteBackground = QuoteBackground;
renderer.QuoteBorderBrush = QuoteBorderBrush;
renderer.QuoteBorderThickness = QuoteBorderThickness;
renderer.QuoteForeground = QuoteForeground;
renderer.QuoteMargin = QuoteMargin;
renderer.QuotePadding = QuotePadding;
renderer.TableBorderBrush = TableBorderBrush;
renderer.TableBorderThickness = TableBorderThickness;
renderer.YamlBorderBrush = YamlBorderBrush;
renderer.YamlBorderThickness = YamlBorderThickness;
renderer.TableCellPadding = TableCellPadding;
renderer.TableMargin = TableMargin;
renderer.TextWrapping = TextWrapping;
renderer.LinkForeground = LinkForeground;
renderer.ImageStretch = ImageStretch;
renderer.ImageMaxHeight = ImageMaxHeight;
renderer.ImageMaxWidth = ImageMaxWidth;
renderer.WrapCodeBlock = WrapCodeBlock;
renderer.FlowDirection = FlowDirection;
_rootElement.Child = renderer.Render();

I looked at Microsoft's documentation and MarkDownTextBlock doesn't have a content attribute

</ControlTemplate>
</Setter.Value>
</Setter>
Expand Down