Example #1
0
        private async void MyEditor_ControlLoaded(object sender, EventArgs e)
        {
            var displayOptions  = DisplayOptions.CreateOptions();
            var editorOptions   = EditorOptions.CreateOptions();
            var languageOptions = await EditorLanguageOptions.GetDefaultEnOptionsAsync();

            editorOptions.Theme = "";
            await MyEditor.Initialize("# Hello Markdown!", displayOptions, editorOptions, "", languageOptions);

            var cssFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/acrmd.css"));

            string css = await FileIO.ReadTextAsync(cssFile);

            await MyEditor.SetPreviewStyle(css);
        }
        private async void MyEditor_ControlLoaded(object sender, EventArgs e)
        {
            var displayOptions = DisplayOptions.CreateOptions(EditBoxDisplayMode.Editor);
            var editorOptions  = EditorOptions.CreateOptions();

            editorOptions.FontFamily = "Microsoft YaHei UI";
            var languageOptions = await EditorLanguageOptions.GetDefaultEnOptionsAsync();

            editorOptions.Theme = "none";
            var mdFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/test.md"));

            string md = await FileIO.ReadTextAsync(mdFile);

            await MyEditor.Initialize(md, displayOptions, editorOptions, "", languageOptions);

            ControlPanel.Visibility = Visibility.Visible;
        }