buttons inside scrollviewer problem
- by Miroslav Valchev
Hello, everyone. I couldn't find a solution to my problem eventhough I believe that others have come across this too. Basically, there are like twenty buttons in a wrap panel, which is inside a scrollviewer. The problem is that when I want to scroll the list, the click event fires the triggers. Really would appreciate help on this one.
<ScrollViewer>
<ScrollViewer.Content>
<toolkit:WrapPanel Orientation="Horizontal"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Width="420">
<Button Style="{StaticResource imageButtonStyle}" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<cmd2:EventToCommand Command="{Binding SelectCommand, Mode=OneWay}"
CommandParameterValue="1" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button Style="{StaticResource imageButtonStyle}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<cmd2:EventToCommand Command="{Binding SelectCommand, Mode=OneWay}"
CommandParameterValue="2" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button Style="{StaticResource imageButtonStyle}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseEnter">
<cmd2:EventToCommand Command="{Binding SelectCommand, Mode=OneWay}"
CommandParameterValue="3" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button Style="{StaticResource imageButtonStyle}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseEnter">
<cmd2:EventToCommand Command="{Binding SelectCommand, Mode=OneWay}"
CommandParameterValue="4" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</toolkit:WrapPanel>
</ScrollViewer.Content>