2009-11-18 23 views
1

需要一些幫助。FlowDocumentPageViewer事件WPF

  1. 是否有任何事件,而我們改變在FlowDocumentPageViewer
  2. 頁面是有任何事件,而我們zoomIn /縮小(ZoomOut)在FlowDocumentPageViewer

最佳, 巴拉。

回答

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被DependencyProperties上MyControl定義。

0

對於母版頁,您可以處理FlowDocumentPageViewer控件模板中DocumentPageView內的PageDisconnected事件。主頁面更改時將引發此事件。在事件處理程序中,您可以將DocumentPageView.PageNumber與您存儲的頁碼值進行比較。