コード例 #1
0
        public void Transform_givenstring()
        {
            var resources = (ResourceDictionary)XamlReader.Parse(Utils.LoadText("IndentTest.xaml"));

            var markdownViewer = new MarkdownScrollViewer();

            markdownViewer.MarkdownStyle = null;

            foreach (var idx in Enumerable.Range(1, 4))
            {
                var jaggingMarkdown = (string)resources["Indent" + idx];
                markdownViewer.HereMarkdown = jaggingMarkdown;
                var document = markdownViewer.Document;
                Approvals.Verify(Utils.AsXaml(document));
            }
        }
コード例 #2
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext = new
     {
         Background  = new SolidColorBrush(Color.Parse(CommonData.theme.Background)),
         Foreground  = new SolidColorBrush(Color.Parse(CommonData.theme.Foreground)),
         Activecolor = new SolidColorBrush(Color.Parse(CommonData.theme.ActiveColor))
     };
     // load controls
     this.inputTbx         = this.FindControl <TextBox>("inputTextBox");
     this.searchBox        = this.FindControl <TextBox>("searchBox");
     this.articleListPanel = this.FindControl <StackPanel>("postItemsPanel");
     this.markdownPreview  = this.FindControl <MarkdownScrollViewer>("markdownPreview");
     this.mainGrid         = this.FindControl <Grid>("mainGrid");
     // load config
     // todo: check config is null or not
     // this.markdownPreview.AssetPathRoot = CommonData.config.PostDirectory;
 }
コード例 #3
0
 public static ICommand GetValidationResult(MarkdownScrollViewer ctrl)
 => ctrl.GetValue(ValidationResultProperty);
コード例 #4
0
 public static void SetValidationResult(MarkdownScrollViewer ctrl, ICommand cmd)
 => ctrl.SetValue(ValidationResultProperty, cmd);
コード例 #5
0
 public static string GetXamlText(MarkdownScrollViewer ctrl)
 => ctrl.GetValue(XamlTextProperty);
コード例 #6
0
 public static void SetXamlText(MarkdownScrollViewer ctrl, string xamlTxt)
 => ctrl.SetValue(XamlTextProperty, xamlTxt);