FlowDocumentReader 没有 GoToPage 方法,但它支持 NavigationCommands.GoToPage RoutedUICommand。
如何从我的代码中(不使用 xaml)将带有参数(例如:1)的 NavigationCommands.GoToPage 发送到我的 FlowDocumentReader ?
谢谢, 亚里夫
编辑:谢谢!但是虽然我可以在你的帮助下发送命令,但我没有得到预期的结果。这是代码(我也尝试使用 FirstPage 而不是 PreviousPage):
if (NavigationCommands.PreviousPage.CanExecute(null, this) == true)
{
NavigationCommands.PreviousPage.Execute(null, this);
}
即使 if 语句为真并且内部代码正在执行,FlowDocumentReader 仍停留在最后一页...