问题
In this page about the Slider control on Windows Phone, in the last paragraph, a behavior is mentionned: http://msdn.microsoft.com/en-us/library/hh202877(v=vs.92).aspx
You can also customize the behavior of a Slider control. Depending on how it’s being used, a Slider control might benefit from the following behaviors:
Move-to-Position: the thumb jumps to the position of the contact.
Snap-to-Tick: the thumb jumps to the tick value that is closest to its current position in the direction of the contact.
But I can't find in the class reference page where those behavior can be specified http://msdn.microsoft.com/en-us/library/system.windows.controls.slider(v=vs.95).aspx
I'm interested in the Move-To-Position one since the other one is the default behavior of the control.
回答1:
I can;t see that paragraph in the link you specify above. Wrong link? Normally to attach behaviors you would do something like this in XAML
<Slider>
<Interactivity:Interaction.Behaviors>
<Behaviours:MyCustomBehavior MyDependProp="someValue" />
</Interactivity:Interaction.Behaviors>
</Slider>
来源:https://stackoverflow.com/questions/10621997/slider-control-with-move-to-position-behavior