I'm trying to bind a method to the value changed of a slider. I'm using devexpress poco,
XAML:
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Height="140" Margin="20">
<Slider Height="100" Width="40" Margin="5" HorizontalAlignment="Left" TickFrequency="10" TickPlacement="BottomRight" Orientation="Vertical" Minimum="0" Maximum="100" Value="{Binding VolumeLevel}">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="ValueChanged" Command="{Binding Path=VolumeChangedCommand}" />
</dxmvvm:Interaction.Behaviors>
</Slider>
<TextBlock Text="{Binding Name}" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
My C# Code:
public void VolumeChanged()
{
...
}
The method never gets called.
Any suggestions?
DataContext? Assuming your current XAML code, it has to be defined in the model/item class. (Which would be inListView.ItemsSource[i].VolumeChangedCommand) - Also yourCommandhas to implement theICommandinterface.