I want to make a margin inside the text editor by using IWpfTextViewMargin.
However, when I access the IWpfTextView.ViewportTop, it sometimes has negative value. How can I get the correct ViewportTop?
By scrolling the vertical scrollbar inside the text editor, the wpf viewport which representing the text will be scrolled. The initial condition of the ViewportTop is 0.0 but sometimes, it will be negative.
How can I get the pixels of actual scrolling distance of the viewport when vertical scrollbar is scrolled?
msdn 论坛回复