C# 当我尝试绑定滑块时,操纵已完成未在eventtocommand(mvvm ligt)上触发
我尝试使用EventTocommand绑定slider事件ManipulationCompleted,但它没有被触发,但ManipulationStarted工作正常有什么办法解决这个问题吗 我的xaml代码:C# 当我尝试绑定滑块时,操纵已完成未在eventtocommand(mvvm ligt)上触发,c#,windows-phone-8,mvvm,mvvm-light,C#,Windows Phone 8,Mvvm,Mvvm Light,我尝试使用EventTocommand绑定slider事件ManipulationCompleted,但它没有被触发,但ManipulationStarted工作正常有什么办法解决这个问题吗 我的xaml代码: <Slider x:Name="Choice_Slider" Grid.Row="2" Minimum="0" Maximum="100" Value="50" Foreground="{x:Null}" Style="{StaticResource SliderStyle1}"
<Slider x:Name="Choice_Slider" Grid.Row="2" Minimum="0" Maximum="100" Value="50" Foreground="{x:Null}" Style="{StaticResource SliderStyle1}" >
<Slider.Background>
<ImageBrush Stretch="UniformToFill" ImageSource="/Assets/Images/sliderbar.png"/>
</Slider.Background>
<i:Interaction.Triggers>
<i:EventTrigger EventName="ManipulationCompleted">
<Command:EventToCommand Command="{Binding SliderStartedCommand, Mode=OneWay}" PassEventArgsToCommand="True"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Slider>
我也有同样的问题。我真的不知道它是否像
Storyboard.Completed
,因为该实现并不像您希望的那样简单,就像您对operationcompleted
所做的那样。您是否尝试过处理代码隐藏中的operationcompleted
事件,并查看它是否触发??!还可以尝试在SliderStartedCommand
属性的get方法中设置RelayCommand
public RelayCommand<ManipulationCompletedEventArgs> SliderStartedCommand
{
get;
private set;
}
SliderStartedCommand = new RelayCommand<ManipulationCompletedEventArgs>((e) => OnSliderMovedDelta(e));
private void OnSliderMovedDelta(ManipulationCompletedEventArgs e)
{
//var Sliderparam = e.
//var xvalue = Sliderparam.X;
}