How to scroll to the top of a FlowDocumentReader?
Content is set by binding
<FlowDocumentReader Grid.Row="4" Grid.Column="0" Name="FlowDocumentPageViewer1" HorizontalAlignment="Stretch">
<FlowDocumentReader.Document>
<Binding ElementName="_this" Path="DocFlow" IsAsync="False" Mode="OneWay"/>
</FlowDocumentReader.Document>
</FlowDocumentReader>
If I scroll down then bind new content it does not scroll to the top.
With new content I want to scroll to the top.
Based on comment from Clemnes this scrolls to the top
FlowDocumentPageViewer1.Document.BringIntoView();
Now my problem is how to automate that call.
I cannot put it in the get as cannot put that command after the return.
Tried these two events but are not fired with a binding update
Loaded="FlowDocumentPageViewer1_loaded"
SourceUpdated="FlowDocumentPageViewer1_loaded"
You may create an attached property that sets the original
Document
property and also callsBringIntoView()
:Now you can bind this property like: