Example #1
0
        /// <summary>
        /// Set new basic foreground after change cursor's color
        /// </summary>
        /// <param name="d"></param>
        /// <param name="e"></param>
        private static void OnCursorColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SyntaxHighlightTextBox sh = (SyntaxHighlightTextBox)d;
            Color c = (Color)e.NewValue;

            sh.Background = new SolidColorBrush(sh.GetAlphaColor(c));
        }
Example #2
0
        /// <summary>
        ///  always set transparent color
        /// </summary>
        /// <param name="d"></param>
        /// <param name="e"></param>
        private static void OnBackgroundChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SyntaxHighlightTextBox sh = (SyntaxHighlightTextBox)d;

            SolidColorBrush b = new SolidColorBrush(sh.GetAlphaColor(sh.CursorColor));
            SolidColorBrush a = e.NewValue as SolidColorBrush;

            if (a == null || a.Color != b.Color)
            {
                sh.Background = b;
            }
        }