Пример #1
0
        public InkSmartCanvasViewPage()
        {
            InitializeComponent();

            Loaded += (sender, eventArgs) =>
            {
                SetCanvasSize();

                strokeService = new InkStrokesService(inkCanvas.InkPresenter);
                var analyzer = new InkAsyncAnalyzer(inkCanvas, strokeService);
                var selectionRectangleService = new InkSelectionRectangleService(inkCanvas, selectionCanvas, strokeService);

                lassoSelectionService = new InkLassoSelectionService(inkCanvas, selectionCanvas, strokeService, selectionRectangleService);
                nodeSelectionService  = new InkNodeSelectionService(inkCanvas, selectionCanvas, analyzer, strokeService, selectionRectangleService);
                pointerDeviceService  = new InkPointerDeviceService(inkCanvas);
                undoRedoService       = new InkUndoRedoService(inkCanvas, strokeService);
                transformService      = new InkTransformService(drawingCanvas, strokeService);
                fileService           = new InkFileService(inkCanvas, strokeService);

                strokeService.ClearStrokesEvent       += (s, e) => RefreshEnabledButtons();
                undoRedoService.UndoEvent             += (s, e) => RefreshEnabledButtons();
                undoRedoService.RedoEvent             += (s, e) => RefreshEnabledButtons();
                undoRedoService.AddUndoOperationEvent += (s, e) => RefreshEnabledButtons();
                pointerDeviceService.DetectPenEvent   += (s, e) => TouchInkingButtonIsChecked = false;
            };
        }
        public InkDrawViewPage()
        {
            InitializeComponent();
            Loaded += (sender, eventArgs) =>
            {
                SetCanvasSize();

                strokeService = new InkStrokesService(inkCanvas.InkPresenter);
                var selectionRectangleService = new InkSelectionRectangleService(inkCanvas, selectionCanvas, strokeService);
                lassoSelectionService = new InkLassoSelectionService(inkCanvas, selectionCanvas, strokeService, selectionRectangleService);
                pointerDeviceService  = new InkPointerDeviceService(inkCanvas);
                copyPasteService      = new InkCopyPasteService(strokeService);
                undoRedoService       = new InkUndoRedoService(inkCanvas, strokeService);
                fileService           = new InkFileService(inkCanvas, strokeService);
                zoomService           = new InkZoomService(canvasScroll);

                touchInkingButton.IsChecked = true;
                mouseInkingButton.IsChecked = true;

                strokeService.CopyStrokesEvent        += (s, e) => RefreshEnabledButtons();
                strokeService.SelectStrokesEvent      += (s, e) => RefreshEnabledButtons();
                strokeService.ClearStrokesEvent       += (s, e) => RefreshEnabledButtons();
                undoRedoService.UndoEvent             += (s, e) => RefreshEnabledButtons();
                undoRedoService.RedoEvent             += (s, e) => RefreshEnabledButtons();
                undoRedoService.AddUndoOperationEvent += (s, e) => RefreshEnabledButtons();
                pointerDeviceService.DetectPenEvent   += (s, e) => touchInkingButton.IsChecked = false;
            };
        }
Пример #3
0
        public InkSmartCanvasPage()
        {
            InitializeComponent();
            Loaded += (sender, eventArgs) =>
            {
                SetCanvasSize();

                var strokeService             = new InkStrokesService(inkCanvas.InkPresenter);
                var analyzer                  = new InkAsyncAnalyzer(inkCanvas, strokeService);
                var selectionRectangleService = new InkSelectionRectangleService(inkCanvas, selectionCanvas, strokeService);

                ViewModel.Initialize(
                    strokeService,
                    new InkLassoSelectionService(inkCanvas, selectionCanvas, strokeService, selectionRectangleService),
                    new InkNodeSelectionService(inkCanvas, selectionCanvas, analyzer, strokeService, selectionRectangleService),
                    new InkPointerDeviceService(inkCanvas),
                    new InkUndoRedoService(inkCanvas, strokeService),
                    new InkTransformService(drawingCanvas, strokeService),
                    new InkFileService(inkCanvas, strokeService));

                // In tabbedpivot projects the ballpoint pen is not selected by default, so we set it explicitly
                toolbar.ActiveTool           = toolbar.GetToolButton(InkToolbarTool.BallpointPen);
                toolbar.ActiveTool.IsChecked = true;
            };
        }
Пример #4
0
        public DrawPage()
        {
            InitializeComponent();
            Loaded += (s, e) => SetCanvasSize();

            var strokeService             = new InkStrokesService(inkCanvas.InkPresenter.StrokeContainer);
            var selectionRectangleService = new InkSelectionRectangleService(inkCanvas, selectionCanvas, strokeService);

            ViewModel = new DrawViewModel(
                strokeService,
                new InkLassoSelectionService(inkCanvas, selectionCanvas, strokeService, selectionRectangleService),
                new InkPointerDeviceService(inkCanvas),
                new InkCopyPasteService(strokeService),
                new InkUndoRedoService(inkCanvas, strokeService),
                new InkFileService(inkCanvas, strokeService),
                new InkZoomService(canvasScroll));
        }
Пример #5
0
        public SmartCanvasPage()
        {
            InitializeComponent();
            Loaded += (s, e) => SetCanvasSize();

            var strokeService             = new InkStrokesService(inkCanvas.InkPresenter.StrokeContainer);
            var analyzer                  = new InkAsyncAnalyzer(inkCanvas, strokeService);
            var selectionRectangleService = new InkSelectionRectangleService(inkCanvas, selectionCanvas, strokeService);

            ViewModel = new SmartCanvasViewModel(
                strokeService,
                new InkLassoSelectionService(inkCanvas, selectionCanvas, strokeService, selectionRectangleService),
                new InkNodeSelectionService(inkCanvas, selectionCanvas, analyzer, strokeService, selectionRectangleService),
                new InkPointerDeviceService(inkCanvas),
                new InkUndoRedoService(inkCanvas, strokeService),
                new InkTransformService(drawingCanvas, strokeService),
                new InkFileService(inkCanvas, strokeService));
        }
Пример #6
0
        public InkDrawViewPage()
        {
            InitializeComponent();
            Loaded += (sender, eventArgs) =>
            {
                SetCanvasSize();

                var strokeService             = new InkStrokesService(inkCanvas.InkPresenter);
                var selectionRectangleService = new InkSelectionRectangleService(inkCanvas, selectionCanvas, strokeService);

                ViewModel.Initialize(
                    strokeService,
                    new InkLassoSelectionService(inkCanvas, selectionCanvas, strokeService, selectionRectangleService),
                    new InkPointerDeviceService(inkCanvas),
                    new InkCopyPasteService(strokeService),
                    new InkUndoRedoService(inkCanvas, strokeService),
                    new InkFileService(inkCanvas, strokeService),
                    new InkZoomService(canvasScroll));
            };
        }
        public InkSmartCanvasPage()
        {
            InitializeComponent();
            SetNavigationViewHeaderContext();
            SetNavigationViewHeaderTemplate();

            Loaded += (sender, eventArgs) =>
            {
                SetCanvasSize();

                var strokeService             = new InkStrokesService(inkCanvas.InkPresenter);
                var analyzer                  = new InkAsyncAnalyzer(inkCanvas, strokeService);
                var selectionRectangleService = new InkSelectionRectangleService(inkCanvas, selectionCanvas, strokeService);

                ViewModel.Initialize(
                    strokeService,
                    new InkLassoSelectionService(inkCanvas, selectionCanvas, strokeService, selectionRectangleService),
                    new InkNodeSelectionService(inkCanvas, selectionCanvas, analyzer, strokeService, selectionRectangleService),
                    new InkPointerDeviceService(inkCanvas),
                    new InkUndoRedoService(inkCanvas, strokeService),
                    new InkTransformService(drawingCanvas, strokeService),
                    new InkFileService(inkCanvas, strokeService));
            };
        }