# ActiViz and WPF Slider

**URL:** https://discourse.vtk.org/t/activiz-and-wpf-slider/9160
**Category:** Support
**Created:** [August 17, 2022, 1:50am UTC](https://discourse.vtk.org/t/activiz-and-wpf-slider/9160 "2022-08-17T01:50:17Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![a772485252](https://discourse.vtk.org/user_avatar/discourse.vtk.org/a772485252/32/5327_2.png) [@a772485252](https://discourse.vtk.org/u/a772485252)
#### Post date: [August 17, 2022, 1:50am UTC](https://discourse.vtk.org/t/activiz-and-wpf-slider/9160/1 "2022-08-17T01:50:17Z")

</div>

When I drag the slider to render, the value of the slider will jump to the maximum or minimum value and then come back. Annotate render, and the slider will be normal.

```auto
private void slider_ValueChanged(object sender,RoutePropertyChangedEventArgs<double> e)
{
     double offset=Math.Abs(e.OldValue-e.NewValue);
    if(e.OldValue>e.NewValue)
    {
         BackValueChangeEvent?.Invoke(offset);
     }
     else
     {
          ForwardValueChangedEvent?.Invoke(offset);
      }
}

private void SliderWindow_BackValueChangedEvent(double offset)
{
     if(isClockwise)
      {
          _renderPackageVR.Camera.Azimuth(offset);
      }
      else
      {
          _renderPackageVR.Camera.Azimuth(-offset);
       }
       _renderPackageVR.RenderWindow.Render();
}

```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [August 29, 2022, 4:39am UTC](https://discourse.vtk.org/t/activiz-and-wpf-slider/9160/3 "2022-08-29T04:39:02Z")

</div>

@LucasGandel
