Reputation: 12658
I have an Application which uses a Slider to show the progress of a video Clip so Its being updated continue-sly through Code to keep it matched with the progress of Video within MediaElement.
I want it(Slider) to not to raise ValueChanged Event (When its values Changes through Code) as I have to handle the ValueChange event only on the User Slide Input.
Can Anybody Help me on this?
Upvotes: 0
Views: 1280
Reputation: 1525
As per my knowledge there no as much event to fire when MediaElement
value changes.
For this purpose, people use the Slider
control attached with the MediaElement
.
Slider control has the event called ValueChanged
which is fired, whenever there is change in the position by the user.
By the Slider bar value you can set the MediaElement position like ex.
int SliderValue = (int)timelineSlider.Value;
TimeSpan ts = new TimeSpan(0, 0, 0, 0, SliderValue);
myMediaElement.Position = ts;
You can find the example for you problem in this link of MSDN, in this link please refer the example given along with the .xaml code and source code.
Upvotes: 0