0

Is there an easy way to make a code TextBox?

I'm trying to make my own limited/specialized version of XAMLPad.

Displaying the current XAML object tree in the top display is simple enough, using XamlReader.Parse() ... But I'd like the actual XAML code in the bottom window to show up in its appropriate colors.

Here is an example of something similar to what I want.

(source: usefulfreeware.net)

The above example looks pretty authentic, with the little expander/collapser thingies on the left side as well as close-to-standard coloration of XAML tokens.

I believe that this doesn't have to be created from scratch, so I'm asking SO if anyone knows where I might find automated support for this type of "code" display.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Giffyguy
  • 20,378
  • 34
  • 97
  • 168

2 Answers2

1

Have a look at sharpdevelop - we use it for an internal iron python editor

Preet Sangha
  • 64,563
  • 18
  • 145
  • 216
  • Ooh, that DOES look sharp. And it's open-source, so I don't have to pay up the butt for it. Can you explain basically how SharpDevelop can be used for this? Does it provide a custom control that does this? Or does it provide functional support only, and I have to add it to my own control? – Giffyguy Aug 05 '09 at 00:04
  • So far, this just lools like a third-party IDE. Is it really going to give my application decent code display, or is it just here to make my life easier as the developer? – Giffyguy Aug 05 '09 at 01:10
  • hi there. I;ll check back at our code and see what component the code editor is. – Preet Sangha Aug 05 '09 at 11:08
1

Kaxaml uses ICSharpCode.TextEditor, the text editor component from SharpDevelop.

Daniel
  • 15,944
  • 2
  • 54
  • 60