FlowDocumentPageViewer WPF的事件

时间:2009-11-18 13:27:00

标签: wpf flowdocument

需要一些帮助。

  1. 我们在FlowDocumentPageViewer
  2. 中更改页面时是否有任何事件
  3. 我们在FlowDocumentPageViewer
  4. 中进行zoomIn / zoomOut时有任何事件

    最佳, 巴拉。

2 个答案:

答案 0 :(得分:1)

我们在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}}"
  ...

MyZoomMyMasterPage是MyControl上定义的DependencyProperties。

答案 1 :(得分:0)

对于母版页,您可以在FlowDocumentPageViewer控件模板中的DocumentPageView内处理PageDisconnected事件。更改母版页时将引发此事件。在事件处理程序中,您可以将DocumentPageView.PageNumber与存储的页码值进行比较。