Home Forums WPF controls Xceed Toolkit Plus for WPF How do I catch the drag start and drag stop events at MaterialSlider

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • sonja
    Participant
    Post count: 7
    #44676 |

    Hi,

    I’m trying to play a mediaElement and for this purpose I’m using your MaterialSlider in order to display the progress of the mediaElement. Now | need when I drag the pointer on the MaterialSlider I need to get this event and to continue playing to the newly dragged timestamp. Like for example a mp3 is playing and has reached to 1 minute, I need jump one part of the mp3 so I drag the slider pointer to the time of 2 minutes and I want the mp3 to continue playing after those 2 minutes. How do i catch the drag start and drag stop events?

    please advice
    thanks

    Fawzi [Xceed]
    Member
    Post count: 722

    Hi,

    The MaterialSlider is a Slider. So you can use the following event handlers :

    <xctk:MaterialSlider x:Name=”materialSlider”
    Thumb.DragStarted=”DragStarted”
    Thumb.DragCompleted=”DragCompleted” >

    private void DragStarted( object sender, DragStartedEventArgs e )
    {
    }

    private void DragCompleted( object sender, DragCompletedEventArgs e )
    {
    }

    Or you can use your own MaterialSlider and override the thumb started/completed methods :
    public class MyMaterialSlider : MaterialSlider
    {
    protected override void OnThumbDragStarted( DragStartedEventArgs e )
    {
    base.OnThumbDragStarted( e );
    }

    protected override void OnThumbDragCompleted( DragCompletedEventArgs e )
    {
    base.OnThumbDragCompleted( e );
    }
    }

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.