Generally on Windows Phone 7 using Silverlight You will use ListBox templates like this one
<ListBox Margin="0,0,-12,0" ItemsSource="{Binding Items}" >
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0,0,0,17"
MouseLeftButtonDown="StackPanel_MouseLeftButtonDown">
<Image Height="150" Width="150"
Source="{Binding ImageSource}" Stretch="UniformToFill" />
<StackPanel Width="311">
<TextBlock Text="{Binding LineOne}"
TextWrapping="Wrap"
Style="{StaticResource PhoneTextExtraLargeStyle}"/>
<TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap"
Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
But on touch based platform such as Windows Phone 7, MouseLeftButtonDown
will trigger event, even if You try scroll ListBox content. Another
approach is to use ManipulationCompleted
event. Event arguments have property named
IsTapEvent
, but in latest Silverlight SDK this property is declared as
Protected
. So You can see it in debugger at runtime, but cannot use in code.
What You can do is subscribe to ManipulationCompleted
event, and check e.TotalManipulation
for
Scale
and Transform
properties equals zero.
private void StackPanel_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
var zero = new Point(0,0);
if( e.TotalManipulation.Scale == zero && e.TotalManipulation.Translation == zero )
MessageBox.Show("gotcha!");
}
I'm Android and Full Stack Software Engineer. 28 years in software industry, lots of finished projects. I’m never afraid of learning something new and you can see it by amount of skills in my resume.
I'm working remotely since 2009, self-motivated and self-organized.
There are no impossible projects. I have experience with Android, iOS, Web, Desktop, Embedded applications, VR, AR, XR, Computer vision, Neural networks, Games, IoT, you name it.