public MainWindow() { InitializeComponent(); MyRichTextBox.AddHandler(RichTextBox.DragOverEvent, new DragEventHandler(MyRichTextBox_DragOver), true); MyRichTextBox.AddHandler(RichTextBox.DropEvent, new DragEventHandler(MyRichTextBox_Drop), true); }