private void btnClear_Click(object sender, RoutedEventArgs e) { string text = ""; editor.Document.GetText(Windows.UI.Text.TextGetOptions.None, out text); ITextRange allText = editor.Document.GetRange(0, text.Length - 1); if (allText != null) { // Reset Character Formats ITextCharacterFormat charFormatting = allText.CharacterFormat; charFormatting.Name = "Segoe UI"; charFormatting.Size = 15f; charFormatting.ForegroundColor = Colors.Black; charFormatting.Bold = charFormatting.Bold = FormatEffect.Off; charFormatting.Italic = charFormatting.Bold = FormatEffect.Off; charFormatting.Underline = Windows.UI.Text.UnderlineType.None; allText.CharacterFormat = charFormatting; // Reset Paragraph Formats and Style ITextParagraphFormat paraFormatting = allText.ParagraphFormat; paraFormatting.ListType = MarkerType.None; //paraFormatting.Style = ParagraphStyle.Undefined; allText.ParagraphFormat = paraFormatting; } }
private void AlignRightButtton_Click(object sender, RoutedEventArgs e) { ITextSelection selectedText = editor.Document.Selection; if (selectedText != null) { ITextParagraphFormat charFormatting = selectedText.ParagraphFormat; selectedText.ParagraphFormat.Alignment = ParagraphAlignment.Right; } }
public static void SetTabLength(this ITextDocument document, int length) { document.DefaultTabStop = length * 3; // Each space has an approximate width of 3 points ITextParagraphFormat format = document.GetDefaultParagraphFormat(); format.ClearAllTabs(); document.SetDefaultParagraphFormat(format); }
private void BulletsButton_Click(object sender, RoutedEventArgs e) { ITextSelection selectedText = Editor.Document.Selection; if (selectedText == null) { return; } ITextParagraphFormat paragraphFormatting = selectedText.ParagraphFormat; if (paragraphFormatting.ListType == MarkerType.Bullet) { paragraphFormatting.ListType = MarkerType.None; } else { paragraphFormatting.ListType = MarkerType.Bullet; } selectedText.ParagraphFormat = paragraphFormatting; }
public void SetDefaultParagraphFormat(ITextParagraphFormat value) { throw new NotImplementedException(); }