【发布时间】:2016-01-26 10:56:54
【问题描述】:
我正在尝试在 Windows 8.1 项目中使用 pdfnet 创建 AnnotationToolbar。
在我的页面 xaml 我有这个
xmlns:toolControls="using:pdftron.PDF.Tools.Controls"
...
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="53" />
<RowDefinition />
</Grid.RowDefinitions>
<toolControls:AnnotationToolbar x:Name="anBar" Height="53"></toolControls:AnnotationToolbar>
<Border Grid.Row="1" x:Name="PDFViewCtrlBorder" Child="{Binding PDFViewCtrl}"/>
</Grid>
在我后面的代码中我有这个
public ToolManager _ToolManager;
pdftron.PDFNet.Initialize();
_ViewModel = new ViewModels.MainPageViewModel();
this.DataContext = _ViewModel;
_ToolManager = new ToolManager(_ViewModel.PDFViewCtrl);
anBar = new pdftron.PDF.Tools.Controls.AnnotationToolbar(_ToolManager);
注释栏已显示,但当我按下任何选项时,我在 AnnotationToolbarViewModel 中得到一个异常,提示 ToolManager 为空。
创建 AnnotationToolbar 的正确方法是什么?
【问题讨论】:
标签: c# xaml windows-runtime pdftron pdfnet