需要一些帮助。
- 当我们更改 FlowDocumentPageViewer 中的页面时是否有任何事件
- 在 FlowDocumentPageViewer 中放大/缩小时是否有任何事件
最好的,巴拉。
需要一些帮助。
最好的,巴拉。
我们在 FlowDocumentPageViewer 中更改页面时是否有任何事件?
是的。每当您更改页面时,FlowDocumentPageViewer.MasterPage 都会更改值。由于它是一个 DP,您可以将自己的 DP 绑定到它,并在您的 DP 上处理 PropertyChangedCallback。
在 FlowDocumentPageViewer 中放大/缩小时是否有任何事件?
是的。每当您更改缩放时,FlowDocumentPageViewer.Zoom 都会更改值。由于它是一个 DP,您可以将自己的 DP 绑定到它,并在您的 DP 上处理 PropertyChangedCallback。
例子:
<FlowDocumentPageViewer
Zoom="{Binding MyZoom, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor,MyControl,1}}"
MasterPage="{Binding MyMasterPage, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor,MyControl,1}}"
...
MyControl上定义的 DependencyProperties 的位置MyZoom
和位置。MyMasterPage
对于母版页,您可以在 FlowDocumentPageViewer 控件模板的 DocumentPageView 中处理 PageDisconnected 事件。更改母版页时将引发此事件。在事件处理程序中,您可以将 DocumentPageView.PageNumber 与您存储的页码值进行比较。