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

Conversation

JulesEmond
Copy link

Fixes

PR Type

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • New component
    • Pull Request has been submitted to the documentation repository instructions. Link:
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
    • If control, added to Visual Studio Design project
  • Sample in sample app has been added / updated (for bug fixes / features)
  • New major technical changes in the toolkit have or will be added to the Wiki e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

Other information

@@ -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

@JulesEmond JulesEmond changed the title Dev/juem/markdowntextblock fix: explicit content in markdowntextblock Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants