助けが必要でした。
- FlowDocumentPageViewer でページを変更しているときに何かイベントはありますか
- FlowDocumentPageViewer で zoomIn/zoomOut を実行しているときに何かイベントがありますか
最高、バラ。
助けが必要でした。
最高、バラ。
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}}"
...
MyZoom
およびは、 MyControlMyMasterPage
で定義された DependencyProperties です。
マスター ページの場合、FlowDocumentPageViewer コントロール テンプレートの DocumentPageView 内で PageDisconnected イベントを処理できます。このイベントは、マスター ページが変更されたときに発生します。イベント ハンドラー内で、DocumentPageView.PageNumber を保存されているページ番号の値と比較できます。