i playing audiofile. position of current track gets displayed silder. value of slider bound property gets updated every 40ms. problem is, when user drages thumb of slider, position gets updated again(of timer every 40ms). result, user not able change thumb. create slider not update value property while user dragging thumb.
i've tried this:
public class sliderdragpriority : slider { bool allowvaluechange = true; protected override void onvaluechanged(double oldvalue, double newvalue) { if (allowvaluechange) base.onvaluechanged(oldvalue, newvalue); //else -> don't change value } protected override void onthumbdragdelta(system.windows.controls.primitives.dragdeltaeventargs e) { } protected override void onthumbdragstarted(system.windows.controls.primitives.dragstartedeventargs e) { base.onthumbdragstarted(e); allowvaluechange = false; } protected override void onthumbdragcompleted(system.windows.controls.primitives.dragcompletedeventargs e) { allowvaluechange = true; base.onthumbdragcompleted(e); } }
the problem of code is, onvaluechanged not affect value property.
Comments
Post a Comment