Exemplo n.º 1
0
        protected override void OnDetachChild(UIElement child)
        {
            CompositionTarget.Rendering -= OnFrameCallback;

            child.PreviewMouseLeftButtonUp -= OnMouseLeftButtonUp;
            _timeTracker = null;
        }
Exemplo n.º 2
0
 private void OnTimerFired(object sender, EventArgs e)
 {
     if (_upperRing < _ringCount)
     {
         _upperRing++;
     }
     else
     {
         _lowerRing++;
         if (_lowerRing >= _upperRing)
         {
             _timeTracker.TimerFired -= OnTimerFired;
             _timeTracker = null;
             CompositionTarget.Rendering -= OnFrameCallback;
         }
     }
     
 }
Exemplo n.º 3
0
 public MagnitismCanvas()
     : base()
 {
     CompositionTarget.Rendering += UpdateChildren;
     _timeTracker = new TimeTracker();
 }
Exemplo n.º 4
0
        private void OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (_timeTracker != null)
            {
                _timeTracker.TimerFired -= OnTimerFired;
                _timeTracker = null;
            }

            CompositionTarget.Rendering += OnFrameCallback;
            _timeTracker = new TimeTracker();
            _timeTracker.TimerInterval = _ringDelayInSeconds;
            _timeTracker.TimerFired += OnTimerFired;
            _lowerRing = _upperRing = 0;
            _clickPosition = e.GetPosition(this);
        }
Exemplo n.º 5
0
        protected override void OnAttachChild(UIElement child)
        {
            CompositionTarget.Rendering += OnFrameCallback;

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

            _timeTracker = new TimeTracker();

        }