-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also added missing TableRow for MarkdownTextBlock
- Loading branch information
Showing
6 changed files
with
127 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...eme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/UWPObjectRenderer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers; | ||
using Markdig.Renderers; | ||
using Markdig.Syntax; | ||
|
||
namespace CommunityToolkit.Labs.WinUI.MarkdownTextBlock.Renderers; | ||
|
||
public abstract class UWPObjectRenderer<TObject> : MarkdownObjectRenderer<WinUIRenderer, TObject> | ||
where TObject : MarkdownObject | ||
{ | ||
} |
44 changes: 44 additions & 0 deletions
44
...s/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/MyTableRow.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements; | ||
using Markdig.Extensions.Tables; | ||
using Microsoft.UI.Xaml.Controls; | ||
using Microsoft.UI.Xaml.Documents; | ||
|
||
namespace CommunityToolkit.Labs.WinUI.MarkdownTextBlock.TextElements; | ||
|
||
internal class MyTableRow : IAddChild | ||
{ | ||
private TableRow _tableRow; | ||
Check warning on line 14 in CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/MyTableRow.cs GitHub Actions / Qodana for .NETNon-accessed field (private accessibility)
|
||
private StackPanel _stackPanel; | ||
private Paragraph _paragraph; | ||
|
||
public TextElement TextElement | ||
{ | ||
get => _paragraph; | ||
} | ||
|
||
public MyTableRow(TableRow tableRow) | ||
{ | ||
_tableRow = tableRow; | ||
_paragraph = new Paragraph(); | ||
|
||
_stackPanel = new StackPanel(); | ||
_stackPanel.Orientation = Orientation.Horizontal; | ||
var inlineUIContainer = new InlineUIContainer(); | ||
inlineUIContainer.Child = _stackPanel; | ||
_paragraph.Inlines.Add(inlineUIContainer); | ||
} | ||
|
||
public void AddChild(IAddChild child) | ||
{ | ||
if (child is MyTableCell cellChild) | ||
{ | ||
var richTextBlock = new RichTextBlock(); | ||
richTextBlock.Blocks.Add((Paragraph)cellChild.TextElement); | ||
_stackPanel.Children.Add(richTextBlock); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters