Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

CodeBox 2: An Extended and Improved Version of the CodeBox with Line Numbers

, 10 Oct 2009 CPOL
A WPF textbox supporting line numbering, highlighting, underlines, and strikethroughs.
ColoredWordPad.zip
ColoredWordPad
MenuItems
Dialogs
Properties
Settings.settings
CodeBoxControl
Decorations
Properties
Settings.settings
ColoredWordPadSample.zip
ColoredWordPad.exe
CodeBoxControl.dll
ColoredWordPadSource.zip
Settings.settings
Settings.settings
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows;
namespace CodeBoxControl
{
    [Serializable]
  public  class CodeBoxSettings:DependencyObject
    {
        #region FontSize
        public static DependencyProperty FontSizeProperty = DependencyProperty.Register("FontSize", typeof(double), typeof(CodeBoxSettings),
        new PropertyMetadata(12d, new PropertyChangedCallback(CodeBoxSettings.OnFontSizeChanged)));

        public double FontSize
        {

            get { return (double)GetValue(FontSizeProperty); }

            set { SetValue(FontSizeProperty, value); }

        }


        private static void OnFontSizeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {


        }
 
        #endregion

        #region BaseColor
        public static DependencyProperty BaseColorProperty = DependencyProperty.Register("BaseColor", typeof(Color), typeof(CodeBoxSettings),
        new PropertyMetadata(Colors.Black , new PropertyChangedCallback(CodeBoxSettings.OnBaseColorChanged)));

        public Color BaseColor
        {

            get { return (Color)GetValue(BaseColorProperty); }

            set { SetValue(BaseColorProperty, value); }

        }


        private static void OnBaseColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {


        }

        #endregion

        #region BackgroundColor
        public static DependencyProperty BackgroundColorProperty = DependencyProperty.Register("BackgroundColor", typeof(Color), typeof(CodeBoxSettings),
        new PropertyMetadata(Colors.White , new PropertyChangedCallback(CodeBoxSettings.OnBackgroundColorChanged) ));

        public Color BackgroundColor
        {

            get { return (Color)GetValue(BackgroundColorProperty); }

            set { SetValue(BackgroundColorProperty, value); }

        }


        private static void OnBackgroundColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {

           
        }
      
        #endregion

        #region FontFamily
        public static DependencyProperty FontFamilyProperty = DependencyProperty.Register("FontFamily", typeof(FontFamily), typeof(CodeBoxSettings),
        new PropertyMetadata(new FontFamily("Verdana"), new PropertyChangedCallback(CodeBoxSettings.OnFontFamilyChanged) ));

        public FontFamily FontFamily
        {

            get { return (FontFamily)GetValue(FontFamilyProperty); }

            set { SetValue(FontFamilyProperty, value); }

        }


        private static void OnFontFamilyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {


        }
    
        #endregion

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

KenJohnson
Software Developer (Senior)
United States United States
Written software for what seems like forever. I'm currenly infatuated with WPF. Hopefully my affections are returned.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141030.1 | Last Updated 10 Oct 2009
Article Copyright 2009 by KenJohnson
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid