Krythic

Slider Click and Drag (Cleaned up)

Feb 25th, 2021
528
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private void AddHandlers()
  2.         {
  3.             HueSpectrumSlider.AddHandler(
  4.                 PreviewMouseLeftButtonDownEvent,
  5.                 new MouseButtonEventHandler((sender, e) =>
  6.                 {
  7.                     if (!HueSpectrumSlider.IsMoveToPointEnabled ||
  8.                     !(HueSpectrumSlider.Template.FindName("PART_Track", HueSpectrumSlider) is Track track) ||
  9.                     track.Thumb?.IsMouseOver != false)
  10.                     {
  11.                         return;
  12.                     }
  13.                     track.Thumb.UpdateLayout();
  14.                     track.Thumb.RaiseEvent(new MouseButtonEventArgs(e.MouseDevice, e.Timestamp, MouseButton.Left)
  15.                     {
  16.                         RoutedEvent = MouseLeftButtonDownEvent,
  17.                         Source = track.Thumb
  18.                     });
  19.                 }),true);
  20.         }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×