Пример #1
0
        public Manipulable()
        {
            _iprocessor = new InertiaProcessor();
            _mprocessor = new ManipulationProcessor();
            _pts        = new Dictionary <int, Point>();

            Guid manipulationEventsId = new Guid(IIDGuid.IManipulationEvents);

            _mprocessor.FindConnectionPoint(ref manipulationEventsId, out _meventsconnectionpoint);
            _meventsconnectionpoint.Advise(this, out _cookie);
            _iprocessor.FindConnectionPoint(ref manipulationEventsId, out _ieventsconnectionpoint);
            _ieventsconnectionpoint.Advise(this, out _cookie);

            OnPivotPointChanged(this, new DependencyPropertyChangedEventArgs());
            OnPivotRadiusChanged(this, new DependencyPropertyChangedEventArgs());
            OnSupportedManipulationsChanged(this, new DependencyPropertyChangedEventArgs());
            OnMinimumScaleRotateRadiusChanged(this, new DependencyPropertyChangedEventArgs());

            _matrotate    = new RotateTransform();
            _matscale     = new ScaleTransform();
            _mattranslate = new TranslateTransform();
            _mattransform = new TransformGroup();

            _mattransform.Children.Add(_matrotate);
            _mattransform.Children.Add(_matscale);
            _mattransform.Children.Add(_mattranslate);
        }
Пример #2
0
        /// <summary>
        /// Create new manipulation processor
        /// </summary>
        /// <remarks>
        /// Call the <see cref="ProcessDown"/>, <see cref="ProcessMove"/>, <see cref="ProcessUp"/> to feed the processor.
        /// Register on <see cref="ManipulationStarted"/>, <see cref="ManipulationDelta"/> and <see cref="ManipulationCompleted"/>
        /// to handle manipulation events
        /// </remarks>
        /// <param name="supportedManipulations">Activate specific manipulation (scale, translate, rotate)</param>
        public ManipulationProcessor(ProcessorManipulations supportedManipulations)
        {
            _comManipulationProcessor = new ManipulationInterop.ManipulationProcessor();
            _comManipulationEvents    = new ManipulationEvents(_comManipulationProcessor, ManipulationEventHandler);

            SupportedManipulations = supportedManipulations;
        }
Пример #3
0
        /// <summary>
        /// Create new manipulation processor
        /// </summary>
        /// <remarks>
        /// Call the <see cref="ProcessDown"/>, <see cref="ProcessMove"/>, <see cref="ProcessUp"/> to feed the processor.
        /// Register on <see cref="ManipulationStarted"/>, <see cref="ManipulationDelta"/> and <see cref="ManipulationCompleted"/>
        /// to handle manipulation events
        /// </remarks>
        /// <param name="supportedManipulations">Activate specific manipulation (scale, translate, rotate)</param>
        public ManipulationProcessor(ProcessorManipulations supportedManipulations)
        {
            _comManipulationProcessor = new ManipulationInterop.ManipulationProcessor();
            _comManipulationEvents = new ManipulationEvents(_comManipulationProcessor, ManipulationEventHandler);

            SupportedManipulations = supportedManipulations;
        }