【问题标题】:create a AnnotationToolbar with pdfnet in windows 8.1在 Windows 8.1 中使用 pdfnet 创建 AnnotationToolbar
【发布时间】: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


    【解决方案1】:

    这是因为 anBar 只是一个指向 UI 树中事物的变量名。将 anBar 设置为新变量实际上不会更改 UI 树中的内容。 相反,您可以尝试调用 anBar.ToolManager = _ToolManager;

    【讨论】:

      猜你喜欢
      • 2016-08-31
      • 2014-01-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多