Ejemplo n.º 1
0
        public MainPageViewModel()
        {
            // Register commands
            CMDOpenFile   = new RelayCommand(OpenFile);
            CMDAddBarCode = new RelayCommand(AddBarcode);

            // Initialize PDFTron's SDK in demo mode
            pdftron.PDFNet.Initialize("");

            // Initialize PDF View Control
            PDFViewCtrl = new PDFViewCtrl();
            PDFViewCtrl.PointerPressed += PDFViewCtrl_PointerPressed;

            // Open getting started PDF file
            PDFDoc doc = new PDFDoc("Resources/GettingStarted.pdf");

            doc.InitSecurityHandler();

            // Load document into PDF View Control
            PDFViewCtrl.SetDoc(doc);

            // Init ToolManager
            toolManager = new ToolManager(PDFViewCtrl);

            // Init Dialog ViewModel
            barcodeViewModel = new BarcodeViewModel();
            BarcodeViewModel = new BarcodeDialogViewModel(new BarcodeDialogService(barcodeViewModel));
        }
Ejemplo n.º 2
0
        async private void AddBarcode()
        {
            await BarcodeViewModel.ShowDialog();

            if ((barcodeViewModel.BarcodeSelected == null) || (barcodeViewModel.BarcodeSelected.Type == BarcodeType.None))
            {
                return;
            }

            barcodeSelected = barcodeViewModel.BarcodeSelected.Type;
            barcodeData     = barcodeViewModel.InputData;
        }
 public BarcodeDialogService(BarcodeViewModel viewModel)
 {
     _barcodeDialog             = new PDFViewerBarcode.Control.BarcodeDialog();
     _barcodeDialog.DataContext = viewModel;
 }