Replies: 4 comments
-
|
Slider是支持拖拽的 |
Beta Was this translation helpful? Give feedback.
0 replies
-
<i:Interaction.Behaviors>
<ic:EventTriggerBehavior EventName="PointerPressed">
<ic:InvokeCommandAction Command="{Binding StartSeekingCommand}"/>
</ic:EventTriggerBehavior>
<ic:EventTriggerBehavior EventName="PointerReleased">
<ic:InvokeCommandAction Command="{Binding StopSeekingCommand}"/>
</ic:EventTriggerBehavior>
</i:Interaction.Behaviors>采用mvvm绑定该怎么写,这样好像只是监听了点击 Thumb.DragStarted="Slider_DragStarted"
Thumb.DragCompleted="Slider_DragCompleted"这样写只有拖动才触发,也不是mvvm的写法,你有示例吗? partial void OnCurrentTimeChanged(long oldValue, long newValue)
{
Debug.WriteLine($"oldValue:{oldValue},newValue:{newValue}");
}实现 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
你应该直接绑定Slider的Value值,在VM层处理Value值的变化 <Slider Value="{Binding Value}" />public partial class SliderDemoViewModel : ObservableObject
{
[ObservableProperty] private double _value;
partial void OnValueChanged(double value)
{
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
嗯,还需要搭配 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
如果我做播放进度条,slider好像不支持拖拽进度,现在有自定义控件支持这个吗
Beta Was this translation helpful? Give feedback.
All reactions