public MagnitismCanvas()
 {
     // suppress movement in the visual studio designer.
     if (Process.GetCurrentProcess().ProcessName != "devenv")
         CompositionTarget.Rendering += UpdateChildren;
     _timeTracker = new ParticleEffectsTimeTracker();
 }
Beispiel #2
0
        protected override void OnAttachChild(UIElement child)
        {
            CompositionTarget.Rendering += OnFrameCallback;

            child.PreviewMouseLeftButtonUp += OnMouseLeftButtonUp;
            child.PreviewMouseMove += OnMouseMove;

            _timeTracker = new ParticleEffectsTimeTracker();
        }
Beispiel #3
0
        protected override void OnDetachChild(UIElement child)
        {
            CompositionTarget.Rendering -= OnFrameCallback;

            child.PreviewMouseLeftButtonUp -= OnMouseLeftButtonUp;
            child.PreviewMouseMove -= OnMouseMove;

            _timeTracker = null;
        }
Beispiel #4
0
        protected override void OnDetachChild(UIElement child)
        {
            CompositionTarget.Rendering -= OnFrameCallback;

            child.PreviewMouseLeftButtonUp -= OnMouseLeftButtonUp;
            child.PreviewMouseMove         -= OnMouseMove;

            _timeTracker = null;
        }
Beispiel #5
0
        protected override void OnAttachChild(UIElement child)
        {
            CompositionTarget.Rendering += OnFrameCallback;

            child.PreviewMouseLeftButtonUp += OnMouseLeftButtonUp;
            child.PreviewMouseMove         += OnMouseMove;

            _timeTracker = new ParticleEffectsTimeTracker();
        }
 public MagnitismCanvas()
 {
     // suppress movement in the visual studio designer.
     if (Process.GetCurrentProcess().ProcessName != "devenv")
     {
         CompositionTarget.Rendering += UpdateChildren;
     }
     _timeTracker = new ParticleEffectsTimeTracker();
 }
Beispiel #7
0
        private void OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (_timeTracker != null)
            {
                _timeTracker.TimerFired -= OnTimerFired;
                _timeTracker = null;
            }

            CompositionTarget.Rendering += OnFrameCallback;
            _timeTracker = new ParticleEffectsTimeTracker {TimerInterval = _ringDelayInSeconds};
            _timeTracker.TimerFired += OnTimerFired;
            _lowerRing = _upperRing = 0;
            _clickPosition = e.GetPosition(this);
        }
Beispiel #8
0
        private void OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (_timeTracker != null)
            {
                _timeTracker.TimerFired -= OnTimerFired;
                _timeTracker             = null;
            }

            CompositionTarget.Rendering += OnFrameCallback;
            _timeTracker = new ParticleEffectsTimeTracker {
                TimerInterval = _ringDelayInSeconds
            };
            _timeTracker.TimerFired += OnTimerFired;
            _lowerRing     = _upperRing = 0;
            _clickPosition = e.GetPosition(this);
        }