|
3 | 3 | // See the LICENSE file in the project root for more information. |
4 | 4 |
|
5 | 5 | using CommunityToolkit.WinUI.Controls; |
6 | | -using Microsoft.UI; |
7 | | -using Microsoft.UI.Text; |
8 | 6 | using System.Diagnostics; |
9 | | -using Windows.UI; |
10 | 7 |
|
11 | 8 | namespace MarkdownTextBlockExperiment.Samples; |
12 | 9 |
|
@@ -603,107 +600,7 @@ public string Text |
603 | 600 | public MarkdownTextBlockExampleSample() |
604 | 601 | { |
605 | 602 | this.InitializeComponent(); |
606 | | - |
607 | | - var themes = new MarkdownThemes |
608 | | - { |
609 | | - // Headings |
610 | | - H1FontSize = 28, |
611 | | - H2FontSize = 24, |
612 | | - H3FontSize = 20, |
613 | | - H4FontSize = 18, |
614 | | - H5FontSize = 16, |
615 | | - H6FontSize = 14, |
616 | | - |
617 | | - H1FontWeight = FontWeights.Bold, |
618 | | - H2FontWeight = FontWeights.SemiBold, |
619 | | - H3FontWeight = FontWeights.Medium, |
620 | | - H4FontWeight = FontWeights.Normal, |
621 | | - H5FontWeight = FontWeights.Normal, |
622 | | - H6FontWeight = FontWeights.Normal, |
623 | | - |
624 | | - H1Foreground = new SolidColorBrush(Colors.Crimson), |
625 | | - H2Foreground = new SolidColorBrush(Colors.DarkOrange), |
626 | | - H3Foreground = new SolidColorBrush(Colors.Goldenrod), |
627 | | - H4Foreground = new SolidColorBrush(Colors.ForestGreen), |
628 | | - H5Foreground = new SolidColorBrush(Colors.SteelBlue), |
629 | | - H6Foreground = new SolidColorBrush(Colors.MediumPurple), |
630 | | - |
631 | | - H1Margin = new Thickness(0, 20, 0, 4), |
632 | | - H2Margin = new Thickness(0, 18, 0, 4), |
633 | | - H3Margin = new Thickness(0, 16, 0, 4), |
634 | | - H4Margin = new Thickness(0, 14, 0, 4), |
635 | | - H5Margin = new Thickness(0, 12, 0, 2), |
636 | | - H6Margin = new Thickness(0, 10, 0, 2), |
637 | | - |
638 | | - // General container |
639 | | - Padding = new Thickness(12), |
640 | | - InternalMargin = new Thickness(6), |
641 | | - CornerRadius = new CornerRadius(6), |
642 | | - |
643 | | - // Paragraph / lists |
644 | | - ParagraphMargin = new Thickness(0, 10, 0, 10), |
645 | | - ParagraphLineHeight = 22, |
646 | | - ListGutterWidth = 28, |
647 | | - ListBulletSpacing = 6, |
648 | | - ListMargin = new Thickness(0, 6, 0, 6), |
649 | | - |
650 | | - // Horizontal rule |
651 | | - HorizontalRuleBrush = new SolidColorBrush(Colors.Gray), |
652 | | - HorizontalRuleThickness = 2, |
653 | | - HorizontalRuleMargin = new Thickness(0, 18, 0, 18), |
654 | | - |
655 | | - // Links |
656 | | - LinkForeground = new SolidColorBrush(Colors.DodgerBlue), |
657 | | - |
658 | | - // Inline code |
659 | | - InlineCodeBackground = new SolidColorBrush(Color.FromArgb(255, 40, 44, 52)), |
660 | | - InlineCodeForeground = new SolidColorBrush(Colors.White), |
661 | | - InlineCodeBorderBrush = new SolidColorBrush(Color.FromArgb(255, 70, 75, 85)), |
662 | | - InlineCodeBorderThickness = new Thickness(1), |
663 | | - InlineCodeCornerRadius = new CornerRadius(3), |
664 | | - InlineCodePadding = new Thickness(4, 0, 4, 0), |
665 | | - InlineCodeFontSize = 13, |
666 | | - InlineCodeFontWeight = FontWeights.SemiBold, |
667 | | - |
668 | | - // Code blocks |
669 | | - CodeBlockBackground = new SolidColorBrush(Color.FromArgb(255, 30, 34, 40)), |
670 | | - CodeBlockForeground = new SolidColorBrush(Colors.Gainsboro), |
671 | | - CodeBlockBorderBrush = new SolidColorBrush(Color.FromArgb(255, 60, 65, 75)), |
672 | | - CodeBlockBorderThickness = new Thickness(1), |
673 | | - CodeBlockPadding = new Thickness(12), |
674 | | - CodeBlockMargin = new Thickness(0, 14, 0, 16), |
675 | | - CodeBlockFontFamily = new FontFamily("Consolas"), |
676 | | - CodeBlockCornerRadius = new CornerRadius(8), |
677 | | - |
678 | | - // Quotes |
679 | | - QuoteBackground = new SolidColorBrush(Color.FromArgb(30, 255, 200, 0)), |
680 | | - QuoteBorderBrush = new SolidColorBrush(Colors.Orange), |
681 | | - QuoteBorderThickness = new Thickness(5, 0, 0, 0), |
682 | | - QuoteForeground = new SolidColorBrush(Colors.DarkSlateGray), |
683 | | - QuoteMargin = new Thickness(0, 10, 0, 10), |
684 | | - QuotePadding = new Thickness(10), |
685 | | - QuoteCornerRadius = new CornerRadius(6), |
686 | | - |
687 | | - // Images |
688 | | - ImageMaxWidth = 420, |
689 | | - ImageMaxHeight = 260, |
690 | | - ImageStretch = Stretch.UniformToFill, |
691 | | - |
692 | | - // Tables |
693 | | - TableBorderBrush = new SolidColorBrush(Colors.DimGray), |
694 | | - TableBorderThickness = 1, |
695 | | - TableCellPadding = new Thickness(8, 4, 8, 4), |
696 | | - TableMargin = new Thickness(0, 18, 0, 18), |
697 | | - TableHeadingBackground = new SolidColorBrush(Color.FromArgb(255, 50, 70, 95)), |
698 | | - |
699 | | - // Other / border defaults |
700 | | - BorderBrush = new SolidColorBrush(Colors.DarkGray), |
701 | | - |
702 | | - // (YAML placeholders if ever used) |
703 | | - YamlBorderBrush = new SolidColorBrush(Colors.DarkGoldenrod), |
704 | | - YamlBorderThickness = new Thickness(1) |
705 | | - }; |
706 | | - _config = new MarkdownConfig { Themes = themes }; |
| 603 | + _config = new MarkdownConfig(); |
707 | 604 | _text = _markdown; |
708 | 605 | MarkdownTextBlock.OnLinkClicked += MarkdownTextBlock_OnLinkClicked; |
709 | 606 | } |
|
0 commit comments