Ejemplo n.º 1
0
        /// <summary>
        /// Attach project editor to container control.
        /// </summary>
        public void AttachEditor()
        {
            _projectEditor    = this.DataContext as ProjectEditor;
            _containerControl = this.Find <ContainerViewControl>("containerControl");
            _zoomBorder       = this.Find <ZoomBorder>("zoomBorder");

            if (_projectEditor != null && _containerControl != null && _zoomBorder != null)
            {
                _projectEditor.Invalidate  = () => _containerControl.InvalidateVisual();
                _projectEditor.ResetZoom   = () => _zoomBorder.Reset();
                _projectEditor.AutoFitZoom = () => _zoomBorder.AutoFit();
                _projectEditor.LoadLayout  = () => { };
                _projectEditor.SaveLayout  = () => { };
                _projectEditor.ResetLayout = () => { };

                _zoomBorder.InvalidatedChild = InvalidateChild;

                _inputProcessor = new InputProcessor(
                    new AvaloniaInputSource(
                        _zoomBorder,
                        _containerControl,
                        _zoomBorder.FixInvalidPointPosition),
                    _projectEditor);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Attach project editor to container control.
        /// </summary>
        public void AttachEditor()
        {
            _projectEditor    = this.DataContext as ProjectEditor;
            _containerControl = this.Find <ContainerViewControl>("containerControl");
            _zoomBorder       = this.Find <ZoomBorder>("zoomBorder");

            if (_projectEditor != null && _containerControl != null && _zoomBorder != null)
            {
                _projectEditor.Invalidate  = () => _containerControl.InvalidateVisual();
                _projectEditor.ResetZoom   = () => _zoomBorder.Reset();
                _projectEditor.AutoFitZoom = () => _zoomBorder.AutoFit();
                _projectEditor.LoadLayout  = () => { };
                _projectEditor.SaveLayout  = () => { };
                _projectEditor.ResetLayout = () => { };

                _zoomBorder.InvalidatedChild = InvalidateChild;
                _zoomBorder.PointerPressed  += ZoomBorder_PointerPressed;
                _zoomBorder.PointerReleased += ZoomBorder_PointerReleased;
                _zoomBorder.PointerMoved    += ZoomBorder_PointerMoved;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Attach project editor to container control.
        /// </summary>
        public void AttachEditor()
        {
            _projectEditor = this.DataContext as ProjectEditor;
            _containerControl = this.Find<ContainerViewControl>("containerControl");
            _zoomBorder = this.Find<ZoomBorder>("zoomBorder");

            if (_projectEditor != null && _containerControl != null && _zoomBorder != null)
            {
                _projectEditor.Invalidate = () => _containerControl.InvalidateVisual();
                _projectEditor.ResetZoom = () => _zoomBorder.Reset();
                _projectEditor.AutoFitZoom = () => _zoomBorder.AutoFit();
                _projectEditor.LoadLayout = () => { };
                _projectEditor.SaveLayout = () => { };
                _projectEditor.ResetLayout = () => { };

                _zoomBorder.InvalidatedChild = InvalidateChild;

                _inputProcessor = new InputProcessor(
                    new AvaloniaInputSource(
                        _zoomBorder,
                        _containerControl,
                        _zoomBorder.FixInvalidPointPosition), 
                    _projectEditor);
            }
        }