コード例 #1
0
        public void Initialize(
            InkStrokesService strokeService,
            InkLassoSelectionService lassoSelectionService,
            InkPointerDeviceService pointerDeviceService,
            InkCopyPasteService copyPasteService,
            InkUndoRedoService undoRedoService,
            InkFileService fileService,
            InkZoomService zoomService)
        {
            _strokeService         = strokeService;
            _lassoSelectionService = lassoSelectionService;
            _pointerDeviceService  = pointerDeviceService;
            _copyPasteService      = copyPasteService;
            _undoRedoService       = undoRedoService;
            _fileService           = fileService;
            _zoomService           = zoomService;

            _strokeService.CopyStrokesEvent        += (s, e) => RefreshCommands();
            _strokeService.SelectStrokesEvent      += (s, e) => RefreshCommands();
            _strokeService.ClearStrokesEvent       += (s, e) => RefreshCommands();
            _undoRedoService.UndoEvent             += (s, e) => RefreshCommands();
            _undoRedoService.RedoEvent             += (s, e) => RefreshCommands();
            _undoRedoService.AddUndoOperationEvent += (s, e) => RefreshCommands();
            _pointerDeviceService.DetectPenEvent   += (s, e) => EnableTouch = false;
        }
コード例 #2
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;
            };
        }
コード例 #3
0
        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;
            };
        }
コード例 #4
0
        public DrawViewModel(
            InkStrokesService _strokeService,
            InkLassoSelectionService _lassoSelectionService,
            InkPointerDeviceService _pointerDeviceService,
            InkCopyPasteService _copyPasteService,
            InkUndoRedoService _undoRedoService,
            InkFileService _fileService,
            InkZoomService _zoomService)
        {
            strokeService         = _strokeService;
            lassoSelectionService = _lassoSelectionService;
            pointerDeviceService  = _pointerDeviceService;
            copyPasteService      = _copyPasteService;
            undoRedoService       = _undoRedoService;
            fileService           = _fileService;
            zoomService           = _zoomService;

            pointerDeviceService.DetectPenEvent += (s, e) => EnableTouch = false;
        }
コード例 #5
0
        public SmartCanvasViewModel(
            InkStrokesService _strokeService,
            InkLassoSelectionService _lassoSelectionService,
            InkNodeSelectionService _nodeSelectionService,
            InkPointerDeviceService _pointerDeviceService,
            InkUndoRedoService _undoRedoService,
            InkTransformService _transformService,
            InkFileService _fileService)
        {
            strokeService         = _strokeService;
            lassoSelectionService = _lassoSelectionService;
            nodeSelectionService  = _nodeSelectionService;
            pointerDeviceService  = _pointerDeviceService;
            undoRedoService       = _undoRedoService;
            transformService      = _transformService;
            fileService           = _fileService;

            pointerDeviceService.DetectPenEvent += (s, e) => EnableTouch = false;
        }
コード例 #6
0
        public void Initialize(
            InkStrokesService strokeService,
            InkLassoSelectionService lassoSelectionService,
            InkNodeSelectionService nodeSelectionService,
            InkPointerDeviceService pointerDeviceService,
            InkUndoRedoService undoRedoService,
            InkTransformService transformService,
            InkFileService fileService)
        {
            _strokeService         = strokeService;
            _lassoSelectionService = lassoSelectionService;
            _nodeSelectionService  = nodeSelectionService;
            _pointerDeviceService  = pointerDeviceService;
            _undoRedoService       = undoRedoService;
            _transformService      = transformService;
            _fileService           = fileService;

            _strokeService.ClearStrokesEvent       += (s, e) => RefreshActions();
            _undoRedoService.UndoEvent             += (s, e) => RefreshActions();
            _undoRedoService.RedoEvent             += (s, e) => RefreshActions();
            _undoRedoService.AddUndoOperationEvent += (s, e) => RefreshActions();
            _pointerDeviceService.DetectPenEvent   += (s, e) => EnableTouch = false;
        }