void RaiseColorChangedEvent(Color color) { ColorChangedEventArgs newEventArgs = new ColorChangedEventArgs(ColorPicker.ColorChangedEvent, color); RaiseEvent(newEventArgs); }
void C_ColorChanged(object sender, ColorChangedEventArgs e) { if ((bool)SyncButton.IsChecked) { try { if (_ColorChangedTimer == null) { _ColorChangedTimer = new DispatcherTimer(TimeSpan.FromMilliseconds(200), DispatcherPriority.Background, _ColorChangedTimer_Tick, this.Dispatcher); } _ColorChangedTimer.Stop(); _ColorChangedTimer.Start(); _ColorChangedColor = e.Color; } catch (Exception ex) { if (ex.IsCriticalException()) { throw; } } } }