WPF: Manage a text editor that can reorder paragraphs by dragging and dropping (e.g. OneNote)

I want to embed one OneNote text editor in my program so that I can easily rearrange paragraphs by dragging and dropping.

enter image description here

Anyone (text editor) open source that can do this?

Thanks.

+6
source share
1 answer
Captain Obviously. Support for text editing in WPF is actually poor. Especially when you are trying to do something more complex by showing a few lines of plain text.

WPF RichTextBox is a cr @p snippet. But still it can be expanded to achieve what you want. All you have to do is create a list of mouse events, and each time it seems to you that the time for displaying this small icon is to show it in the adorner layer above the editor. This post has good examples of how to do this: Richtextbox Resizing Adorner

If you need an open source WPF text editor, I would be surprised if you could find something better than AvalonEdit . Not only magnificent architecture, but also pleasant and joyful reading. Even if it does not support your function directly - it is open source, and the adorner trick still applies.

PS: Sorry for being too emotional in this answer. I've seen too much to be calm when it comes to text editing in WPF blush

+3
source

Source: https://habr.com/ru/post/888988/


All Articles