예제 #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);
        }