.NET source code?

Yeah, sure we all just use reflector anyway, but according to Scott Guthrie we'll be able to step into the source code of certain parts of the .NET framework with VS.NET 2008.

"We'll begin by offering the source code (with source file comments included) for the .NET Base Class Libraries (System, System.IO, System.Collections, System.Configuration, System.Threading, System.Net, System.Security, System.Runtime, System.Text, etc), ASP.NET (System.Web), Windows Forms (System.Windows.Forms), ADO.NET (System.Data), XML (System.Xml), and WPF (System.Windows).  We'll then be adding more libraries in the months ahead (including WCF, Workflow, and LINQ).  The source code will be released under the Microsoft Reference License (MS-RL)."

I can't even begin to describe how useful this is going to be for me.

WPF Binding to RichTextBox.Document

I was getting some nice crashes on startup while trying to do some data binding to the Document property on RichTextBox under WPF and so I hit the net and found out that it's not possible. I quickly came up with the following code, which seems to work:

class BindableRichTextBox : RichTextBox
{
    public static readonly DependencyProperty DocumentProperty =
DependencyProperty.Register("Document", typeof(FlowDocument), typeof(BindableRichTextBox), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnDocumentChanged)));

    public new FlowDocument Document
    {
        get { return (FlowDocument)GetValue(DocumentProperty); }
        set { SetValue(DocumentProperty, value); }
    }

    static void OnDocumentChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
    {
        RichTextBox rtb = (RichTextBox)obj;
        rtb.Document = (FlowDocument)args.NewValue;
    }

}

Now the problem I have is that I don't know why the framework doesn't do this itself and if it's going to cause me massive problems further down the road.