public MagnitismCanvas() { // suppress movement in the visual studio designer. if (Process.GetCurrentProcess().ProcessName != "devenv") CompositionTarget.Rendering += UpdateChildren; _timeTracker = new ParticleEffectsTimeTracker(); }
protected override void OnAttachChild(UIElement child) { CompositionTarget.Rendering += OnFrameCallback; child.PreviewMouseLeftButtonUp += OnMouseLeftButtonUp; child.PreviewMouseMove += OnMouseMove; _timeTracker = new ParticleEffectsTimeTracker(); }
protected override void OnDetachChild(UIElement child) { CompositionTarget.Rendering -= OnFrameCallback; child.PreviewMouseLeftButtonUp -= OnMouseLeftButtonUp; child.PreviewMouseMove -= OnMouseMove; _timeTracker = null; }
public MagnitismCanvas() { // suppress movement in the visual studio designer. if (Process.GetCurrentProcess().ProcessName != "devenv") { CompositionTarget.Rendering += UpdateChildren; } _timeTracker = new ParticleEffectsTimeTracker(); }
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); }
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); }