Пример #1
0
        private void Bold_Click(object sender, RoutedEventArgs e)
        {
            ITextSelection selectedText = EventDescription.Document.Selection;

            if (selectedText != null)
            {
                selectedText.CharacterFormat.Bold = FormatEffect.Toggle;
            }
            EventDescription.Focus(FocusState.Programmatic);
        }
Пример #2
0
        private void Underline_Click(object sender, RoutedEventArgs e)
        {
            ITextSelection selectedText = EventDescription.Document.Selection;

            if (selectedText != null)
            {
                ITextCharacterFormat charFormatting = selectedText.CharacterFormat;
                selectedText.CharacterFormat.Underline = (charFormatting.Underline == UnderlineType.None) ? UnderlineType.Single : UnderlineType.None;
            }
            EventDescription.Focus(FocusState.Programmatic);
        }