예제 #1
0
        private void ChangeTextProperty(DependencyProperty dp, string value)
        {
            if (TextZone == null)
            {
                return;
            }
            TextSelection ts = TextZone.Selection;

            if (ts != null)
            {
                ts.ApplyPropertyValue(dp, value);
            }
            TextZone.Focus();
        }
예제 #2
0
        private void UnderlineBnt_Unselected(object sender, RoutedEventArgs e)
        {
            if (TextZone == null)
            {
                return;
            }
            TextSelection ts = TextZone.Selection;

            if (ts != null)
            {
                (ts.GetPropertyValue(Inline.TextDecorationsProperty) as TextDecorationCollection).TryRemove(TextDecorations.Underline, out TextDecorationCollection textDecorations);
                ts.ApplyPropertyValue(Inline.TextDecorationsProperty, textDecorations);
            }
            TextZone.Focus();
        }